Select , scroll to specific row programmatically
Select , scroll to specific row programmatically
hawkmaster
Posts: 56Questions: 20Answers: 0
Hello
I try to select and mark a row of a table programmatically.
I found this old post where someone made a function goToRow.
But I have problems with jQuery('#DataTablesDIV .dataTables_scrollBody')[0].scrollHeigh
I cannot find a ID DataTablesDIV inside my HTML code.
Was there a change?
if(kdID != ''){
$('#myTable tr').each(function(i) {
var id = $(this).find("td").eq(0).html();
if(id == kdID){
alert('found ' + i + '-' + kdID);
$("#myTable tbody tr").eq(i).addClass('row_selected');
//goToRow(i, oProjectTable)
return false;
}
i+1;
});
Is there another way to scroll to a row in a table with a given columns (unique) value?
best regards
Hans
This discussion has been closed.
Answers
Nobody an idea how can do this?
Isn't that just the id of the div where the datatable is in? Like a div you make and name yourself?
Perhaps my description was wrong.
Example:
Data table was filled from Db with 100 records. Column 1 is "rowid"
I have a scrollable table so you can see about 10 records at once.
A user fill in a textfield number "1234", klick enter.
Then the datatable content should scroll to the row where column 1 = 1234