|
valuesToSelectorAttrMethodJS
valuesToSelectorAttrWiki > Syntax > valuesToSelector > [valuesToSelectorAttrMethodJS ] Parameters
Associative array or Object containing markup, text or instance of Callback. Defines pattern matching target nodes. %k represents key. Defaults to ".%k", which matches nodes with class name equivalent to data source key. For example, to restrict match to nodes with additional class "foo" change selectorPattern to ".foo.%k" Array of fields from values which should be skipped. Callback triggered after every insertion. Two parameters are passed to this callback: DescriptionInjects markup from values' content (rows or attributes) nodes matched by selector. Method uses actually matched nodes as root for the query. ExampleMarkup<p class='field1'>lorem ipsum</p> <p class='field2'>lorem ipsum</p> Datavar values = {
'field1' => '<foo/>',
'field2' => '<bar/>',
};QueryTemplates formula in JavaScript$template .valuesToSelectorAttr(values) Template<p class="field1" rel="<foo/>">lorem ipsum</p> <p class="field2" rel="<bar/>">lorem ipsum</p> Template tree beforep.field1 - Text:lorem ipsum p.field2 - Text:lorem ipsum Template tree afterp.field1 - Text:lorem ipsum p.field2 - Text:lorem ipsum See: Comments allowed |
► Sign in to add a comment