I make a menu tree for the role, If checkbox from the tree is checked, the menu will be appear and if not checked the menu should be hidden
I also make a combo to select the user that will be given the right to access the menu.
I want the tree is automatically checked when I select the user in a combo that has its privileges from database.
it’s my code:
var dhxtree = layout2.cells(“a”).attachTree();
dhxtree.setSkin(‘dhx_skyblue’);
dhxtree.setImagePath(“assets/dhtmlx/imgs/csh_bluebooks/”);
dhxtree.enableCheckBoxes(1);
dhxtree.enableThreeStateCheckboxes(true);
dhxtree.loadXML(“roleuser/getmenu2”);
//load form
var Dataform = [
{type: “fieldset”, name: “dataUser”, label: “Select User”, inputWidth: “auto”,
list:[{
type:“combo”,name:“usercombo”,label:“User ID”,labelWidth:50,inputWidth:150
},
{type:“button”, name:“refresh_combo”, value:“Refresh”, offsetTop:5,offsetLeft:60}
]},
{type: “fieldset”, name: “dataUserSet”, label: “Set Otoritas User”, inputWidth: 250,
list:[
{type:“button”, name:“btn_set_om”, value:“Otoritas Menu”},
{type:“newcolumn”},
{type:“button”, name:“cbtn_keluar”, value:“Keluar”}
]}
]
var formCariUser = layout2.cells(“b”).attachForm(Dataform);
var v_usercombo = formCariUser.getCombo(“usercombo”);
v_usercombo.loadXML(“roleuser/usercombo”);
formCariUser.attachEvent(“onButtonClick”, function(name,command){
switch(name){
case “refresh_combo”:
//What code should I write here?
break;
}
});
it’s my XML from
thx for help…
can i re-loadXML on event button click with include the checked=“1” on response XML?
Darya
June 25, 2012, 4:00pm
#3
Could you make and attach completed demo, please?
docs.dhtmlx.com/doku.php?id=othe … leted_demo