This example shows how to achieve "freeze pane" locking functionality similar to Excel.
Note that the js is not minified so it is readable. See locking-grid.js.