Data Grid - Column Locking

Column locking can be establish only when a data grid object is being created. The 4th parameter of the command dax_dataGrid allows you to set the number of leftmost column that you want to lock.

    Syntax: dax_dataGrid(selection, location, headerRows, lockedLeftColumns, useControlColumn);

The rightmost columns can also locked by executing the command setRightLockedColumns.

    Syntax: setRightLockedColumns(number of locked right columns);

Note: Column locking can be done before the execution on of the command go() only.


Example 1: Lock the leftmost columns

    // Lock the first column
    myGrid = new dax_dataGrid('Hospital', $('mydiv'), 1, 1, false);
    myGrid.go();

    // Lock the first and second column
    myGrid = new dax_dataGrid('Hospital', $('mydiv'), 1, 2, false);
    myGrid.go();

    // Lock the first through third column
    myGrid = new dax_dataGrid('Hospital', $('mydiv'), 1, 3, false);
    myGrid.go();


Example 2: Lock the rightmost columns

    // Lock the last column
    myGrid = new dax_dataGrid('Hospital', $('mydiv'), 1, 0, false);
    myGrid.setRightLockedColumns(1);
    myGrid.go();

    // Lock the last 2 columns
    myGrid = new dax_dataGrid('Hospital', $('mydiv'), 1, 0, false);
    myGrid.setRightLockedColumns(2);
    myGrid.go();

    // Lock the last 3 column
    myGrid = new dax_dataGrid('Hospital', $('mydiv'), 1, 0, false);
    myGrid.setRightLockedColumns(3);
    myGrid.go();

Example 3: Lock the both left and rightmost columns at the same time

    // Lock the first and last column
    myGrid = new dax_dataGrid('Hospital', $('mydiv'), 1, 1, false);
    myGrid.setRightLockedColumns(1);
    myGrid.go();