YUI - DataTable - RadioCellEditor issue

269 views Asked by At

I am using YUI Datatable. myDataTable = new YAHOO.widget.DataTable("cellediting", myColumnDefs, myDataSource, { });

Added RadioCellEditor. var radioEditor = new YAHOO.widget.RadioCellEditor({ radioOptions:["1","0"],disableBtns:true }); radioEditor.subscribe("saveEvent", saveChange);

saveChange is customise function which send ajax request and update the data in the table.

Everything is working fine. But if click on radio cell option and instead of selecting provided option click some other areas of YUI then saveChange() function is calling 4 times. How to resolve this issue?

1

There are 1 answers

0
freb On

Without more information we can't know exactly what the problem is. There is, however, a better way to do what you want. As of version 2.6 of YUI, you can use the asyncSubmitter option with an of the editors, including RadioCellEditor. This is called when a cell is edited and has better error handling in cases where the information submitted isn't successfully submitted to the database, i.e. won't update the datatable.

This article gives detailed information about how it works: http://www.yuiblog.com/blog/2008/10/27/datatable-260-part-two/