EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
December 21, 2025, 11:57:10 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
Datagrid SelectRow issue.
Pages: [
1
]
« previous
next »
Print
Author
Topic: Datagrid SelectRow issue. (Read 14859 times)
fonzie
Newbie
Posts: 9
Datagrid SelectRow issue.
«
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.
Logged
stworthy
Administrator
Hero Member
Posts: 3581
Re: Datagrid SelectRow issue.
«
Reply #1 on:
May 02, 2017, 01:16:47 AM »
Please set the 'idField' property for the datagrid.
Logged
fonzie
Newbie
Posts: 9
Re: Datagrid SelectRow issue.
«
Reply #2 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();
}
" >
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...