mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 09:05:16 +01:00
Parsing the 'modifications' array
This commit is contained in:
parent
b382dc570f
commit
f00d5aba60
@ -34,7 +34,7 @@ var et2_valueWidget = et2_baseWidget.extend({
|
||||
},
|
||||
|
||||
transformAttributes: function(_attrs) {
|
||||
this._super.call(this, arguments);
|
||||
this._super.apply(this, arguments);
|
||||
|
||||
if (this.id != "")
|
||||
{
|
||||
|
@ -483,12 +483,22 @@ var et2_widget = Class.extend({
|
||||
}
|
||||
},
|
||||
|
||||
transformAttributes: function() {
|
||||
/**
|
||||
* Apply the "modifications" to the element
|
||||
*/
|
||||
transformAttributes: function(_attrs) {
|
||||
var data = this.getArrayMgr("modifications").getValueForID(this.id);
|
||||
|
||||
if (data instanceof Object)
|
||||
{
|
||||
for (var key in data)
|
||||
{
|
||||
_attrs[key] = data[key];
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
createElementFromNode: function(_node) {
|
||||
|
||||
// Fetch all attributes for this element from the XML node
|
||||
var attributes = {};
|
||||
|
||||
// Parse the "readonly" and "type" flag for this element here, as they
|
||||
|
@ -85,12 +85,14 @@ etemplate2.prototype._createArrayManagers = function(_data)
|
||||
}
|
||||
|
||||
// Create all neccessary _data entries
|
||||
var neededEntries = ["content", "sel_options", "readonlys", "modifications", "validation_errors"];
|
||||
var neededEntries = ["content", "sel_options", "readonlys", "modifications",
|
||||
"validation_errors"];
|
||||
for (var i = 0; i < neededEntries.length; i++)
|
||||
{
|
||||
if (typeof _data[neededEntries[i]] == "undefined")
|
||||
{
|
||||
et2_debug("log", "Created not passed entry '" + neededEntries[i] + "' in data array.");
|
||||
et2_debug("log", "Created not passed entry '" + neededEntries[i] +
|
||||
"' in data array.");
|
||||
_data[neededEntries[i]] = {};
|
||||
}
|
||||
}
|
||||
|
@ -77,6 +77,12 @@ var timesheet_data = {
|
||||
},
|
||||
"validation_errors": {
|
||||
"ts_title": "Please enter some meaningful title here!"
|
||||
},
|
||||
"modifications": {
|
||||
"ts_quantity": {
|
||||
"width": "200px",
|
||||
"class": "blue"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -205,6 +205,9 @@
|
||||
.fullWidth select { widht: 100%; }
|
||||
.fullWidth input { widht: 100%; }
|
||||
.fullWidth textarea { widht: 100%; }
|
||||
.blue {
|
||||
background-color: #f0f0ff;
|
||||
}
|
||||
</styles>
|
||||
</template>
|
||||
</overlay>
|
||||
|
Loading…
Reference in New Issue
Block a user