mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-19 04:46:42 +02:00
Small design improvements, fixed horz. scrollbar in grid with chrome, ie compatibility, enabled column selection, fixed prefetch code
This commit is contained in:
@@ -39,7 +39,7 @@ function egwGrid(_parentNode, _columns, _objectManager, _fetchCallback, _context
|
||||
// Create the outer view component and pass the dataRoot element so that
|
||||
// the grid outer element will be capable of fetching the root data and
|
||||
// can create a spacer for that.
|
||||
this.gridOuter = new egwGridViewOuter(_parentNode, this.dataRoot);
|
||||
this.gridOuter = new egwGridViewOuter(_parentNode, this.dataRoot, this.selectcolsClick, this);
|
||||
this.gridOuter.updateColumns(this.columns.getColumnData());
|
||||
}
|
||||
|
||||
@@ -48,6 +48,32 @@ egwGrid.prototype.setActionLinkGroup = function(_group, _links)
|
||||
this.dataRoot.actionLinkGroups[_group] = _links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the action link groups.
|
||||
*
|
||||
* @param object _groups is an object used as associative array, which will be
|
||||
* merged into the existing actionLinkGroups
|
||||
* @param boolean _replace specifies whether existing action link groups will
|
||||
* be deleted. Defaults to false.
|
||||
*/
|
||||
egwGrid.prototype.setActionLinkGroups = function(_groups, _replace)
|
||||
{
|
||||
if (typeof _replace == "undefined")
|
||||
{
|
||||
_replace = false;
|
||||
}
|
||||
|
||||
if (_replace)
|
||||
{
|
||||
this.dataRoot.actionLinkGroups = {};
|
||||
}
|
||||
|
||||
for (var k in _groups)
|
||||
{
|
||||
this.dataRoot.actionLinkGroups[k] = _groups[k];
|
||||
}
|
||||
}
|
||||
|
||||
egwGrid.prototype.resize = function(_w, _h)
|
||||
{
|
||||
if (_w != this.width)
|
||||
@@ -78,6 +104,42 @@ egwGrid.prototype.columnsUpdate = function(_column)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the selectcols callback
|
||||
*/
|
||||
egwGrid.prototype.selectcolsClick = function(_at)
|
||||
{
|
||||
var column_data = this.columns.getColumnVisibilitySet();
|
||||
|
||||
// Create a menu which contains these elements and show it
|
||||
var menu_data = [];
|
||||
for (var k in column_data)
|
||||
{
|
||||
var col = column_data[k];
|
||||
|
||||
menu_data.push(
|
||||
{
|
||||
"id": k,
|
||||
"caption": col.caption,
|
||||
"enabled": col.enabled,
|
||||
"checkbox": true,
|
||||
"checked": col.visible
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
var menu = new egwMenu();
|
||||
menu.loadStructure(menu_data);
|
||||
|
||||
var self = this;
|
||||
menu.setGlobalOnClick(function(_elem) {
|
||||
column_data[_elem.id].visible = _elem.checked;
|
||||
self.columns.setColumnVisibilitySet(column_data);
|
||||
});
|
||||
|
||||
menu.showAt(_at.offset().left, _at.offset().top);
|
||||
}
|
||||
|
||||
/**
|
||||
* Emptys the grid
|
||||
*/
|
||||
|
Reference in New Issue
Block a user