I have the following toolbar and treetable.
Clicking on the Toolbar buttons I get $$(…) not defined
In addition, I need to know how to get the index (not id) of the treetable item clicked on so I can insert before, after or indented:
webix.ready(function(){
webix.ui({
container: "gridTreeToolbar",
view: "toolbar",
height: 22,
width: 1127,
cols: [
{ view:"button", type:"image", image:"../images/tree_insert_above.png",
label:"Insert Above",
width:100,
align:"left",
tooltip:"Insert new Subject/Action Item above current",
click:addAbove(1)},
{ view:"button", type:"image", image:"../images/tree_insert_below.png",
label:"Insert Below",
width:100,
align:"left",
tooltip:"Insert new Subject/Action Item below current",
click:addBelow(1)},
{ view:"button", type:"image", image:"../images/tree_append.png",
label:"Append Indented",
width:100,
align:"left",
tooltip:"Add new Action Item indented within current",
click:addAppended(1)},
]
});
var grida = new webix.ui({
container:"gridTree",
view:"treetable",
headerRowHeight:20,
select:"row",
scrollX:true,
scrollY:true,
editable:true,
editaction:"dblclick",
columns:[
{ id:"id", header:"Id", css:{"text-align":"center"}, width:50},
{ id:"type", header:"Type", css:{"text-align":"left"}, width:80},
{ id:"action", header:"Action Items", editor:"text", width:980, template:"{common.space()}{common.icon()} #value#", fillspace:1},
{ id:"due", header:"Due", editor:"text", width:100}
],
autoheight:false,
autowidth:false,
data: actionItems
});
grida.hideColumn("id");
// grida.hideColumn(“type”);
grida.attachEvent(“onItemClick”, function(id, e, node){
console.log("id: " + id);
});
function addAbove(ndx) {
//$$('gridTree').add({ title: "New one "})
}
function addBelow(ndx) {
//$$('gridTree').add({ title: "New one "})
}
function addAppended(ndx) {
//$$('gridTree').add({ title: "New one "})
}
});