In w2ui library there are several jQuery plugins for common purposes. These plugins provide common functions to rendering, destroying
widgets, highlighting text, creating context menus, etc.
$().w2render(name)
jQuery plugin to render previously created element. For example, if you have created a grid and now want to render it to a different container,
you can do this:
xxxxxxxxxx
1
w2ui['myGrid'].render($('#id')[0]); // will give an error if element #id does not exist
2
or
xxxxxxxxxx
1
$('#id').w2render('myGrid'); // no error occurs if element #id does not exist
2
Both ways do same action, but second one is much more human readable.
$().w2destroy(name)
jQuery plugin to destroy previously created element. It will destroy w2ui control and remove it from w2ui object. If the control does not exist no
action will be take.
$().w2marker(str)
jQuery plugin that highlights text. It is internally used in the grid.
xxxxxxxxxx
1
$('#id').w2marker('text'); // will highlight all occurrences of work text within the element.