EasyUI Forum
October 19, 2025, 02:40:15 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Get row index using a field value in datagrid  (Read 15433 times)
contestant
Newbie
*
Posts: 40


View Profile Email
« on: April 07, 2015, 09:44:11 AM »

hello

How get row index using a field value in datagrid?

Tanks Wink
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: April 07, 2015, 06:08:54 PM »

You can call 'getRowIndex' method to get the special row index. This method accepts an id field value as its parameter value. Before calling it the 'idField' property must be set.
Code:
var dg = $('#dg').datagrid({
  idField: ...
});
var index = dg.datagrid('getRowIndex', idvalue);
Logged
contestant
Newbie
*
Posts: 40


View Profile Email
« Reply #2 on: April 08, 2015, 05:34:10 AM »

Thanks for your answer, But there is another problem on this solution...

I use draggable datagrid rows, So if I set idField and dragg row, after drop it, It will move into target row and hide it.

There is way to stop moving rows in together as a tree node?!

Thanks again
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!