Freeze column and fixed header in Table or GridView
- Default scrollbar of browser
- Freeze Header, Column, Footer (only last row)
- Download the latest release from GitHub
- Include the
gridviewscroll.jsin web page
<scripttype="text/javascript" src="js/gridviewscroll.js"></script>- Initialize table with options, then call
enhance
<scripttype="text/javascript">window.onload=function(){vargridViewScroll=newGridViewScroll({elementID : "gvMain"// Target element id});gridViewScroll.enhance();}</script><scripttype="text/javascript">vargridViewScroll=newGridViewScroll({elementID : "",// Stringwidth : 700,// Integer or String(Percentage)height : 350,// Integer or String(Percentage)freezeColumn : false,// BooleanfreezeFooter : false,// BooleanfreezeColumnCssClass : "",// StringfreezeFooterCssClass : "",// StringfreezeHeaderRowCount : 1,// IntegerfreezeColumnCount : 1,// Integeronscroll: function(scrollTop,scrollLeft)// onscroll event callback});</script><scripttype="text/javascript">vargridViewScroll=newGridViewScroll({elementID : "gvMain"});gridViewScroll.enhance();varscrollPosition=gridViewScroll.scrollPosition// get scroll positionvarscrollTop=scrollPosition.scrollTop;varscrollLeft=scrollPosition.scrollLeft;varscrollPosition={scrollTop: 50,scrollLeft: 50};gridViewScroll.scrollPosition=scrollPosition;// set scroll position</script><scripttype="text/javascript">vargridViewScroll=newGridViewScroll({elementID : "gvMain"});gridViewScroll.enhance();// Apply the gridviewscroll featuresgridViewScroll.undo();// Undo the DOM changes, And remove gridviewscroll features</script><scripttype="text/javascript">vargridViewScroll=newGridViewScroll({elementID : "gvMain",onscroll: function(scrollTop,scrollLeft){console.log("scrollTop: "+scrollTop+", scrollLeft: "+scrollLeft);}});gridViewScroll.enhance();</script>- Internet Explorer 9+
- Google Chrome (61.0.3163.100)
- Mozilla FireFox (56.0.2)
If you have any question with gridviewscroll welcome to filing an issue on GitHub, I will try my best to help.
Or you can send email to twlikol@msn.com.
Copyright © Likol Lee. Licensed under the MIT license.
This version is no longer supported, you can find in link: https://github.com/twlikol/GridViewScroll/tree/v0.9.6.8
