This is a migrated thread and some comments may be shown as answers.

About select a row in grid (not the first row as your example)

2 Answers 99 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rinaldo
Top achievements
Rank 1
Rinaldo asked on 10 Oct 2012, 05:44 PM
Dear,
I've two question about select a row in grid:

1) How I must call select method to select a second row of grid, or third row, ecc... (not the first row as your example)
2) How I must call select method to select a row that a certain field contains a specific value ?

Thanks,
Rinaldo

2 Answers, 1 is accepted

Sort by
0
Rinaldo
Top achievements
Rank 1
answered on 12 Oct 2012, 08:56 AM
Dear,
I've two question about select a row in grid:

1) How I must call select method to select a second row of grid, or third row, ecc... (not the first row as your example)
2) How I must call select method to select a row that a certain field contains a specific value ?

Thanks,
Rinaldo
0
Rinaldo
Top achievements
Rank 1
answered on 18 Oct 2012, 04:07 PM
I've resolved in this way:

var gridServizi = $("#gridServizi").data("kendoGrid");
   var i = 0;
   var bTrovato = false;
   var row = gridServizi.tbody.find('tr:eq('+i+')');
   while(row!=null && row[0]!=null && row[0].innerHTML!=null && !bTrovato)
   {
      var nPos = row[0].innerHTML.indexOf(strCodice);
      if( nPos>0)
      {
         bTrovato = true;
      }
      else
      {
         i++;
         row = gridServizi.tbody.find('tr:eq('+i+')');
      }
   }
   if(bTrovato)
   {
      gridServizi.select(row);
   }

But how can scroll grid at row that select ?
Or is there another way to select a specific record ?

Thanks,
Rinaldo
Tags
Grid
Asked by
Rinaldo
Top achievements
Rank 1
Answers by
Rinaldo
Top achievements
Rank 1
Share this question
or