-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement of JsTree 3 themes and plugins support #49
Improvement of JsTree 3 themes and plugins support #49
Conversation
this attribute allow to enable jstree plugins like search, sort, dnd, massload,...
- add examples in showcase for search plugin with/without ajax usage - add example for themeVariant and responsive usage
@flofourcade thank you for this valuable contribution! It is merged now in the 4.0.1 branch. |
Does this search feature work for you? When I click on search nothing happens. |
Yes it works. On the non AJAX example, if you type twitter, the node Struts @ Twitter must be highlighted and all his parent nodes opened. |
Search works but I have a JS error, even if it does not block the search for me. <sj:submit value="Search" button="true"
onclick="$('#treeSearch').jstree('search', $('#searchField').val())" /> by <sj:a onclick="$('#treeSearch').jstree('search', $('#searchField').val())" button="true" >Search</sj:a> in tree.jsp and tree-json.jsp. |
What you think about using two new attributes on the jstree component? searchTopic = Define a topic which triggers the search Then we don't need a onClick with code we just need to define a topic which can be published by any other element. |
Yes, at first I wanted to do thing this way But there are a lot of other plugins (sort,massload,, )and so I had to add a lot of new attributes to handle the config of each plugin. So I choosed to use only one "generic" attribute for all plugins., at first. |
- added searchTopic, searchElementId and onSearchCompleteTopics - update showcase
@jogep |
Sorry, but it looks like a new PR is necessary. |
OK. The search plugin has also "clear_search" method and event. To be complete on the search plugin, I'll add it to tree tag then submit a new PR. |
- added searchClearTopic and onSearchClearTopics
plugins
attribute in<sjt:tree />
.It expects an JSON formatted string with key -> plugin name and value -> the config object for the plugin
(eg
plugins="{search:{ajax:false}}
to enable jstree search plugin without AJAX.)Be careful, you can override here configuration of plugins already defined with other tag attributes (checkbox, contextmenu...). This behaviour can be easily altered by a little change in jquery.tree.struts2.js
Some JsTree 3 themes now support variant (eg "large") and responsive mode.
You can configure this with the new
jstreethemeVariant="variant_name"
andjstreethemeResponsive="boolean"
attributes.