EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Pierre on March 06, 2017, 07:53:53 AM



Title: [SOLVED] Select Cell after row update
Post by: Pierre on March 06, 2017, 07:53:53 AM
Hello
I'm using datagrid cell editing extension and here is the problem:
after doubleclicking on some cell on column A and after updating value on column B, previously selected cell in column A is no more selected. I'm updating row like:
Code:
  $('#dg').datagrid('updateRow',{
    index: index,
    row: {
      total: amount
    }
  });  
How can selected cell remain selected like before I call updateRow?
With other words, if I don't call updateRow, cell remain selected but I need to somehow update cell on column B and I don't see updateCell so I call updateRow and it de-selects cell which was selected and edited.
Thank you.


Title: Re: Select Cell after row update
Post by: jarry on March 06, 2017, 11:51:12 PM
Please call the 'gotoCell' method to move to the special cell after calling 'updateRow' method.
Code:
$('#dg').datagrid('updateRow', ...);
$('#dg').datagrid('gotoCell', {
  index: index,
  field: 'itemid'
});


Title: Re: Select Cell after row update
Post by: Pierre on March 07, 2017, 02:23:19 AM
Awesome! Thank you so much.