EasyUI Forum
May 05, 2024, 04:42:48 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: scroll to a specific row , the first time to load the datagrid. using scrollview  (Read 10427 times)
catpaw
Jr. Member
**
Posts: 85


View Profile Email
« on: May 26, 2015, 09:00:24 AM »

Hi , I'm using the scrollview extension

if I want to scroll to a row that is not in the first 50 rows, the scrollTo does not work.
here my datagrid properties:

Code:
pagination:false,
rownumbers:true,
nowrap:false,
fitColumns:false,
singleSelect:true,
striped:true,
showFooter:true,
remoteSort:false,
view:scrollview,
autoRowHeight:false,
pageSize:50

the only way that worked was putting the method when loading the datagrid.

when I load the datagrid need to make a scrollTo to the row that already have a variable:

Code:
onLoadSuccess: function(data){
      $('#dgA').datagrid('scrollTo',ind);
}

the method scrollTo put it in the onloadSucces event, the first time works fine, but when I navigate in the scroll , the datagrid is reloaded then the scroll back to row, I can not continue to browse the rows of the datagrid

Where should I put the method or the way the ScrollView can load all the data and is not limited by pageSize???

thanks
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: May 26, 2015, 06:51:46 PM »

Please refer to this topic http://www.jeasyui.com/forum/index.php?topic=4592.0
Logged
catpaw
Jr. Member
**
Posts: 85


View Profile Email
« Reply #2 on: May 27, 2015, 06:41:41 AM »

hi sworthy

I had already read this post,

the funny thing is that when you put a fixed number works.
but when I put the variable is not working.

for the variable to the index where the scroll will be made , I have this code:

Code:
click: function (e) {
var area = this.name.substring(2,4);
var ind = 0;
var ban = 0;
$('#dgA').datagrid('getPanel').panel('expand',true);
$('#dgA').datagrid({
collapsed:false,
rowStyler: function(index,row){
if(row.clave===undefined){
//alert('a');
} else{
var clv = row.clave; //alert(clv);
var clave = clv.substring(2); //alert(clave);
if (clave==area){
if(ban==0){
ind = index; //alert(ind);
ind = ind+1; //alert(ind);
ban = 1;
}
return 'background-color:#ffee00;font-weight:bold;';
}
}
}
});
alert(ind);
$('#dgA').datagrid('scrollTo',40); //------------> when I put fixed number works
$('#dgA').datagrid('scrollTo',ind); //------------> when I put the variable does not work
}

what I'm trying to do. is that when they give click a point on a chart . highlight the datagrid rows that are related to that point.
and at the same time, then scroll to the first row that matches the point

so, Also try to do in the onloadsucces method but only works for the first time , as again after reload the datagrid, scroll back to the given row

What I can do?

thanks
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!