setCustomNodeParams
The method sets the custom element parameters passed in the array. Used when processing element properties when defining a custom taskbar. (See also Adding custom toolbars).
*In visual mode, code fragments or other elements can be substituted with their visual representation, for example icons (thumbnails). Properties of these elements are stored in the serialized form as an attribute of this element. This method serializes properties and saves them.void oBXEditorUtils.setCustomNodeParams( object pNode array arParams );
Parameters
Parameter | Description |
---|---|
pNode | A DOM node of the document structure or a [link=90257]BXNodeElement[/link] object, that is passed to UnParseElement() when defining the class of the user taskbar. (See also Adding custom toolbars). |
arParams | Property array. Both associated and nested arrays are possible. |
Returned value
This method does not return a value.Examples
<script> function CustomTaskbar() { var oTaskbar = this; CustomTaskbar.prototype.OnTaskbarCreate = function () { //... } CustomTaskbar.prototype.ShowProperties = function(_bNew, _pTaskbar, _pElement) { //... var _arParams = oBXEditorUtils.getCustomNodeParams(_pElement);//Returns property array _arParams['value'] = 'new value'; //... oBXEditorUtils.setCustomNodeParams(_pElement,_arParams);//Sets property array //... } CustomTaskbar.prototype.UnParseElement = function(node) { //... var arParams = oBXEditorUtils.getCustomNodeParams(node);//Returns property array //... arParams['property'] = 'new property'; //... oBXEditorUtils.setCustomNodeParams(node,arParams);//Sets property array //... return false; } } </script>
See Also getCustomNodeParams()
© «Bitrix24», 2001-2024