Is there a way to set the value of a cell editor?
I have a grid whereby 1 column is ‘editable’. When a cell on this column is ‘double clicked’, the value of the cell changes to that of the adjacent cell. Because the cell will be in ‘edit mode’ when the cell is double clicked, I need to change the value of the editor, NOT the value of the cell…
At the moment I am using the following code (this works but could probably be done better):
$("#grid").on('celldoubleclick', function(e){
// Insert the value from balance if the cell
// is 'this_pack'
if(e.args.datafield=='this_pack'){
// Get the balance from the row
var balance = $('#grid').jqxGrid('getcellvalue',e.args.rowindex,'balance');
$("#grid").jqxGrid('endcelledit',e.args.rowindex,'this_pack',true);
$("#grid").jqxGrid('setcellvalue',e.args.rowindex,'this_pack',balance);
$("#grid").jqxGrid('begincelledit',e.args.rowindex,'this_pack');
}
});