How I can get top of row index after do scrolling table ???

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How I can get top of row index after do scrolling table ???

temp
When I use this function to common table, it's work :
document.getElementById('btn').onclick = function() {
    var tbl = document.getElementById('tbl');
    var scrollAmt = document.getElementById('asdf').scrollTop;
    var totalRowHeight = 0,
        viewTolerance = 1/3,
        rowHeight;    
    for( var i = 0; i < tbl.rows.length; i++ ) {
        totalRowHeight += rowHeight = tbl.rows[i].offsetHeight;      
        if( totalRowHeight > scrollAmt ) {
            var rowIndex =
                (totalRowHeight - scrollAmt < rowHeight*viewTolerance)
                ? i + 1: i;
            tbl.rows[rowIndex].style.backgroundColor = '#ff00ff';
            break;
        }
    }
}

But, when I implemented this code into dandelion datatable it's not work.
This is my table header :

Anyone can help me ???

I always get same value when I scroll the table..why ????