new Utils()
Helper methods about widget.
- Source:
Methods
-
(static) createFromHash(parentOrElementOrDocument, defineObj) → {Kekule.Widget.BaseWidget}
-
Create widget from a definition hash object. The hash object may include the following fields: { 'widgetClass' or 'widget': widget class, class object or string, must have, 'htmlClass': string, HTML class name should be added to widget, 'children': array of child widget definition hash } Other fields will be set to properties of widget with the same names. If the field name starts with '#' and the value is a function, then the function will be set as an event handler.
Parameters:
Name Type Description parentOrElementOrDocumentVariant defineObjHash - Source:
Returns:
-
(static) getBelongedResponsiveWidget(element) → {Kekule.Widget.BaseWidget}
-
Returns widget the element belonged to. The widget must be a non-static one.
Parameters:
Name Type Description elementHTMLElement - Source:
Returns:
-
(static) getBelongedWidget(element) → {Kekule.Widget.BaseWidget}
-
Returns widget the element belonged to.
Parameters:
Name Type Description elementHTMLElement - Source:
Returns:
-
(static) getWidgetById(id, doc) → {Kekule.Widget.BaseWidget}
-
Returns an ID specified widget in document.
Parameters:
Name Type Description idString docHTMLDocument - Source:
Returns:
-
(static) getWidgetOnElem(element) → {Kekule.Widget.BaseWidget}
-
Returns widget binding on element.
Parameters:
Name Type Description elementHTMLElement - Source:
Returns:
-
(static) getWidgetsInsideElem(element, checkElemInsideWidget) → {Array}
-
Returns all widgets in element and its child elements.
Parameters:
Name Type Description elementHTMLElement checkElemInsideWidgetBool - Source:
Returns:
- Type
- Array
-
(static) setWidgetPropFromElemAttrib(widget, attribName, attribValue)
-
When binding to element, properties of widget can be set by element attribute values. This method helps to turn string type attribute values to proper type and set it to widget.
Parameters:
Name Type Description widgetKekule.Widget.BaseWidget attribNameString attribValueString - Source: