Layui Example for implementing Checkbox’s directory tree Tree

There is not much nonsense, I will go directly to the code, the friends you need can come over

  Layui.USE (['Tree'], Function (['Tree'], FUNCTION {$ = layui.jqury; form = layui.form; // Get Node data gettreedata ();}); function gettreedata () {$. ajax ({URL: Path + "/ rolecontroller / getResourcetree.do", TYPE: "POST", DATATYPE: "JSON", DATA: {"RoleId": RoleId, "ID": NULL, "T": math.random ()}, error: function () {}, success: function (data) {Treedata = JSON.STRINGY (DATA); INITMENUTREE ();}});} // List Function InitMenutree () {// JSON Duo Sister Convert to Object Treedata = EVAL ("(" + TREEDATA + ")") ; // console.log (treedata); // Perform rendering treeins = layui.tree ({elem: '#demo', // specify element, which element is put on which element is put on check: 'checkbox', // 勾Select Skin: 'as', // Set Skin Drag: True, // Click on Each When you generate a prompt information CheckBoxName:' aa [], // check box Name property value CheckboxStyle: "", // Set the style of the check box, you must be a string, how to write click CLICK: Function(iTeM) {// click Node Press (ITEM);}, Change: Function (item) {// When the current INPUT changes, the callback //console.log (IITEM) (ITEM) (ITEM) (ResourceceIDs=Item); }, data: {// Add additional data to the element, add DATA-XXX = "YYY" on the element, optional Haschild: true}, NODES: TREEDATA};}  

The above-mentioned Layui implements the CHECKBOX directory tree Tree’s example is the full content of Xiaobian sharing, I hope to give you a reference, I hope everyone will support Tumi Cloud.

© Copyright Notice
THE END
Just support it if you like
like0
share
comment Grab the couch

Please log in to comment