First,I want to show one or two buttons (for example one is delete button ,another is update
button) according to the returned different values in the elements of list, dataview, grid.
Secondly, when one button click , it would execute a function(the update_modal function) .I
want to transfer one parameter to the update_modal function , how can I transfer this
parameter?
I check samples\ui\list\11_active.html
There is a way to embed simple controls in the elements of list, dataview, grid.
There are my codes in the following:
dhx.ready(function() {
dhx.protoUI({
name:"activeDataview"
},dhx.ui.dataview,dhx.ActiveContent);
dhx.ui({
id:"dd",
rows: [
{
view: "activeDataview",
id: "myActiveDataview",
url: "long_list1.json",
activeContent:{
oneButton:{
id:"two",
view:"toolbar",
type:"subBar",
elements:[
{
view:"button",
label:"updateBtn",
id:"updateBtn",
width:100,
earlyInit:true,
type:"round",
click:"update_modal"
},
{
view:"button",
label:"deleteBtn",
id:"closeBtn",
width:100,
earlyInit:true,
type:"round",
click:"delete_modal"
}
]
},
twoButtons:{
id:"one",
view:"toolbar",
type:"subBar",
elements:[
{
view:"button",
label:"updateBtn",
id:"updateBtn",
width:100,
earlyInit:true,
type:"round",
click:"update_modal"
}
]
}
},
template:function(obj){
if(obj.num=='1'){ // according to obj.num ,show one button
return obj.title+"<br> <div style='float:right'>{common.oneButton()}</div>";
}else if(obj.num=='2'){ // show two button
return obj.title+"<br> <div style='float:right'>{common.twoButtons()}</div>";
}
} ,
type: {
width: "1000",
height:"auto"
},
select:false
}]
});
});
Thanks for help in advance !