12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <%@ page contentType="text/html;charset=UTF-8" %>
- <script>
- $(document).ready(function() {
- var to = false;
- $('#search_q').keyup(function () {
- if(to) { clearTimeout(to); }
- to = setTimeout(function () {
- var v = $('#search_q').val();
- $('#userJsTree').jstree(true).search(v);
- }, 250);
- });
- $('#userJsTree').jstree({
- 'core' : {
- "multiple" : false,
- "animation" : 0,
- "loaded_state" : true,
- "themes" : { "variant" : "large", "icons":true , "stripes":true},
- 'data' : {
- "url" : "${ctx}/leader/org/leaderOrgNo/treeData",
- "dataType" : "json"
- }
- },
- "conditionalselect" : function (node, event) {
- return false;
- },
- 'plugins': ["state",'types', 'wholerow', "search"],
- "types":{
- 'default' : { 'icon' : 'fa fa-folder' },
- '1' : {'icon' : 'fa fa-home'},
- '2' : {'icon' : 'fa fa-umbrella' },
- '3' : { 'icon' : 'fa fa-group'},
- '4' : { 'icon' : 'fa fa-file-text-o' }
- }
- }).bind("activate_node.jstree", function (obj, e) {
- var node = $('#userJsTree').jstree(true).get_selected(true)[0];
- var opt = {
- silent: true,
- query:{
- 'officeId':node.id
- }
- };
- var id = node.id == '0' ? '' :node.id;
- $("#officeId").val(id);
- $("#officeName").val(node.text);
- $('#table').bootstrapTable('refresh');
- }).on('loaded.jstree', function() {
- //$("#carKind1jsTree").jstree('open_all');
- });
- });
- function refreshTree() {
- $('#userJsTree').jstree("refresh");
- }
- </script>
|