EasyUI Forum
December 21, 2025, 06:58:50 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: treegrid 'select' method scrolls to row  (Read 14057 times)
itay-g
Newbie
*
Posts: 35


View Profile
« on: June 18, 2014, 03:15:46 AM »

Hi,
I'm trying to select a row in a tree-grid and i noticed that when i'm using the 'select' method, it scrolls to the row.
Is there a way to select a row without scrolling?

Thanks a lot
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: June 21, 2014, 01:35:53 AM »

Please try to use 'highlightRow' method instead.
Logged
itay-g
Newbie
*
Posts: 35


View Profile
« Reply #2 on: June 23, 2014, 01:04:38 AM »

Hi,
highlightRow method doesn't help me because i need to select the row.
Is there any other solution?

Thanks,
Logged
itay-g
Newbie
*
Posts: 35


View Profile
« Reply #3 on: July 02, 2014, 03:17:26 AM »

Hi,
Have you come up with a solution yet? I really need to solve this issue.

Thank you
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #4 on: July 02, 2014, 04:42:34 AM »

Please try to extend a new method to achieve this functionality.
Code:
$.extend($.fn.datagrid.methods, {
  selectRow2: function(jq, index){
    return jq.each(function(){
      var dc = $(this).data('datagrid').dc;
      var top = dc.body2.scrollTop();
      $(this).datagrid('selectRow', index);
      dc.body2.scrollTop(top);
    })
  }
})

Call 'selectRow2' method to select a special row without scrolling.
Code:
$('#tg').treegrid('selectRow2', 3);
Logged
itay-g
Newbie
*
Posts: 35


View Profile
« Reply #5 on: July 03, 2014, 06:30:56 AM »

It works! Thank you
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!