forked from extern/egroupware
Implemented new selectmode in grid, added grid.setSelectmode method to set the selectmode
This commit is contained in:
parent
48221b6bc2
commit
1c600b919d
@ -18,7 +18,8 @@ uses
|
||||
egw_action_columns
|
||||
*/
|
||||
|
||||
function egwGrid(_parentNode, _columns, _objectManager, _fetchCallback, _columnChangeCallback, _context)
|
||||
function egwGrid(_parentNode, _columns, _objectManager, _fetchCallback,
|
||||
_columnChangeCallback, _context)
|
||||
{
|
||||
this.parentNode = _parentNode;
|
||||
this.objectManager = _objectManager;
|
||||
@ -66,6 +67,14 @@ function egwGrid(_parentNode, _columns, _objectManager, _fetchCallback, _columnC
|
||||
this.gridOuter.updateColumns(this.columns.getColumnData());
|
||||
}
|
||||
|
||||
var EGW_SELECTMODE_DEFAULT = 0;
|
||||
var EGW_SELECTMODE_TOGGLE = 1;
|
||||
|
||||
egwGrid.prototype.setSelectmode = function(_mode)
|
||||
{
|
||||
this.gridOuter.grid.selectmode = _mode;
|
||||
}
|
||||
|
||||
egwGrid.prototype.setActionLinkGroup = function(_group, _links)
|
||||
{
|
||||
this.dataRoot.actionLinkGroups[_group] = _links;
|
||||
|
@ -854,6 +854,9 @@ function egwGridViewGrid(_grid, _heightChangeProc, _scrollable, _outer)
|
||||
container.doInsertIntoDOM = egwGridViewGrid_doInsertIntoDOM;
|
||||
container.doSetViewArea = egwGridViewGrid_doSetviewArea;
|
||||
|
||||
// Set the default selectmode
|
||||
container.selectmode = EGW_SELECTMODE_DEFAULT;
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
@ -1494,9 +1497,18 @@ function egwGridViewRow__columnClick(_shiftState, _column)
|
||||
var state = this.aoi.getState();
|
||||
var isSelected = egwBitIsSet(state, EGW_AO_STATE_SELECTED);
|
||||
|
||||
this.aoi.updateState(EGW_AO_STATE_SELECTED,
|
||||
!egwBitIsSet(_shiftState, EGW_AO_SHIFT_STATE_MULTI) || !isSelected,
|
||||
_shiftState);
|
||||
switch (this.grid.selectmode)
|
||||
{
|
||||
case EGW_SELECTMODE_DEFAULT:
|
||||
this.aoi.updateState(EGW_AO_STATE_SELECTED,
|
||||
!egwBitIsSet(_shiftState, EGW_AO_SHIFT_STATE_MULTI) || !isSelected,
|
||||
_shiftState);
|
||||
break;
|
||||
case EGW_SELECTMODE_TOGGLE:
|
||||
this.aoi.updateState(EGW_AO_STATE_SELECTED, !isSelected,
|
||||
egwSetBit(EGW_AO_SHIFT_STATE_MULTI, _shiftState, true));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function egwGridViewRow__checkboxClick()
|
||||
|
Loading…
Reference in New Issue
Block a user