zombeerose
12 Dec 2008, 1:04 PM
I have created a plugin that provides a simple solution to disable/enable rows within a grid. Any disabled rows are visually apparent and "theme-safe."
The following methods get added to the grid:
grid.disableRow(id)
grid.enableRow(id)
grid.isRowDisabled(id)
grid.enableAllRows()
grid.disableAllRows()
The id parameter is the record id of the row to disable/enable
Example usage:
var grid = new Ext.grid.EditorGrid({plugins:new Ext.ux.grid.DisableRow(), ...})
var record = grid.getStore().getAt(0);
var id = record.id;
//applies load mask to row and prevents any further selection.
grid.disableRow(id);
...
//removes the existing load mask and allows for row selection.
grid.enableRow(id);
...
//determine if a row is disabled.
var isDisabled = grid.isRowDisabled(id);
Known issues:
* When config option preventSelection is true, using the cursor to vertically navigate rows in the grid will stop if it encounters a disabled row.
Please refer to the UX repo for latest code changes and better docs. I will try to keep this post current as well.
Version history:
5/19/9: v0.6 Fix for Ext 3.0 compatibility
1/12/9: v0.5 Fix bug to prevent conflicts between multiple grids.
12/16/8: v0.4
12/15/8: v0.3
12/12/8: v0.1 Alpha release
The following methods get added to the grid:
grid.disableRow(id)
grid.enableRow(id)
grid.isRowDisabled(id)
grid.enableAllRows()
grid.disableAllRows()
The id parameter is the record id of the row to disable/enable
Example usage:
var grid = new Ext.grid.EditorGrid({plugins:new Ext.ux.grid.DisableRow(), ...})
var record = grid.getStore().getAt(0);
var id = record.id;
//applies load mask to row and prevents any further selection.
grid.disableRow(id);
...
//removes the existing load mask and allows for row selection.
grid.enableRow(id);
...
//determine if a row is disabled.
var isDisabled = grid.isRowDisabled(id);
Known issues:
* When config option preventSelection is true, using the cursor to vertically navigate rows in the grid will stop if it encounters a disabled row.
Please refer to the UX repo for latest code changes and better docs. I will try to keep this post current as well.
Version history:
5/19/9: v0.6 Fix for Ext 3.0 compatibility
1/12/9: v0.5 Fix bug to prevent conflicts between multiple grids.
12/16/8: v0.4
12/15/8: v0.3
12/12/8: v0.1 Alpha release