|
Title: Datagrid SelectRow issue. Post by: fonzie on May 02, 2017, 01:10:13 AM I want to be able to highlight (eg select) the same row in a datagrid after reloading the data (eg after saving a change in a form).
If I DON'T call 'reload' (which I need to do to display the changes made on a form) I can select a row by calling 'selectRow', but if DO call 'reload', no row is selected. Is there a workaround ?, is this a bug?, am I doing something wrong? . Here is the code I'm using :- var row = $('#dg').datagrid('getSelected'); var index = $('#dg').datagrid('getRowIndex', row); $('#dg').datagrid('reload'); // reload the user data $('#dg').datagrid('selectRow', index); Thank you in advance for any assistance. Title: Re: Datagrid SelectRow issue. Post by: stworthy on May 02, 2017, 01:16:47 AM Please set the 'idField' property for the datagrid.
Title: Re: Datagrid SelectRow issue. Post by: fonzie on May 02, 2017, 01:53:25 AM Thank you so much, that now works perfectly.
For anyone else who has this issue, here is how I implemented it : <table id="dg" title="text here" class="easyui-datagrid" style="width:1500px;height:100%" data-options=" url:'./support_files/get_users.php', toolbar:'#toolbar', pagination:true, rownumbers:true, fitColumns:true, singleSelect:true, idField:'ID', onClickRow:function(){ showUser(); } " > |