EasyUI Forum
May 07, 2024, 11:52:53 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Unable highlightRow for second page and further  (Read 5506 times)
BinaryCode
Newbie
*
Posts: 38


View Profile
« on: March 02, 2014, 08:29:26 PM »

Hello,

I try to load data to datagrid as client side mode with options:
 data-options="
               rownumbers:true,
               singleSelect:true,
               autoRowHeight:false,
               pagination:true,
               pageSize:50,fit:true, pageList:[10,50,100]"

i try to move next page using this script:
 
gridTripReport.datagrid('scrollTo', tripIndex);
gridTripReport.datagrid('highlightRow', tripIndex);

those success execute and row highlighted, then i move to next page success execute

pageNumber++;
pagerGridTripReport = gridTripReport.datagrid("getPager");
pagerGridTripReport.pagination('select', pageNumber);

but problem happend when highlightRow for second and further page:

gridTripReport.datagrid('scrollTo', tripIndex);
gridTripReport.datagrid('highlightRow', tripIndex);

Above script doesnot highlight Row,

What the main problem?

TIA



« Last Edit: March 02, 2014, 09:14:47 PM by BinaryCode » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: March 03, 2014, 02:17:00 AM »

When calling 'select' method to move page to next, the data is not loaded immediately. You are 'highlightRow' an un-existing row, this is why errors happen. To solve this issue, please call 'highlightRow' method after loading data successfully.
Code:
$('#dg').datagrid({
  onLoadSuccess: function(){
    $(this).datagrid('scrollTo',...).datagrid('highlightRow',...);
  }
});
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!