mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-16 03:34:48 +02:00
Add empty row placeholder
This commit is contained in:
@ -32,6 +32,8 @@ var et2_nextmatch_rowProvider = Class.extend({
|
||||
this._rowProvider = _rowProvider;
|
||||
this._subgridCallback = _subgridCallback;
|
||||
this._context = _context;
|
||||
|
||||
this._createEmptyPrototype();
|
||||
},
|
||||
|
||||
/**
|
||||
@ -179,6 +181,25 @@ var et2_nextmatch_rowProvider = Class.extend({
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Placeholder for empty row
|
||||
*
|
||||
* The empty row placeholder is used when there are no results to display.
|
||||
* This allows the user to still have a drop target, or use actions that
|
||||
* do not require a row ID, such as 'Add new'.
|
||||
*/
|
||||
_createEmptyPrototype: function() {
|
||||
var label = this._context && this._context.options && this._context.options.settings.placeholder;
|
||||
|
||||
var placeholder = $j(document.createElement("td"))
|
||||
.attr("colspan",this._rowProvider.getColumnCount())
|
||||
.css("height","19px")
|
||||
.text(typeof label != "undefined" && label ? label : egw().lang("No matches found"))
|
||||
this._rowProvider._prototypes["empty"] = $j(document.createElement("tr"))
|
||||
.addClass("egwGridView_empty")
|
||||
.append(placeholder);
|
||||
},
|
||||
|
||||
/** -- PRIVATE FUNCTIONS -- **/
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user