From 5eede4a8ef4de3bbd8c1a1453f36a29893e331a2 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 28 Apr 2013 12:43:18 +0000 Subject: [PATCH] allow to use in xet files --- etemplate/js/et2_core_widget.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/etemplate/js/et2_core_widget.js b/etemplate/js/et2_core_widget.js index b7a910d4c4..06d56d0768 100644 --- a/etemplate/js/et2_core_widget.js +++ b/etemplate/js/et2_core_widget.js @@ -659,6 +659,19 @@ var et2_widget = Class.extend( // Parse the attributes from the given XML attributes object this.parseXMLAttrs(_node.attributes, attributes, constructor.prototype); + + // check if parseXMLAttrs gives a different type attribute eg. type="@${row}[type]" + if (attributes.type && attributes.type != _nodeName) + { + // set _nodeName and constructor accordingly + _nodeName = attributes.type; + constructor = typeof et2_registry[_nodeName] == "undefined" ? + et2_placeholder : et2_registry[_nodeName]; + if (readonly && typeof et2_registry[_nodeName + "_ro"] != "undefined") + { + constructor = et2_registry[_nodeName + "_ro"]; + } + } // Do an sanity check for the attributes constructor.prototype.generateAttributeSet(attributes);