I am using Jqgrid Tree View model in ma application and what i can see is that it shows error as object or property is not supported i have included grid.Treeview.js and other Jqgrid script file. I dont know what can be the issue. And when i checked the sample application in net for adjacency tree view and i tried the same thing but in asp.net with local data which i did not get. Can any one help me how to do the same. Thanks in advance
This is the sample code that im using and more over i dont whether will it work or not.
var myTreeGrid = new Ext.us.tree.TreeGrid({
columns: columnsConfig,
rootVisible: false,
root: rootNode,
loader: new Ext.ux.tree.TreeGridLoader({preloadChildren: true})
});
var rootNode = $('#treegridsamp').jqgrid({
treeGrid: true,
treeGridModel: 'adjacecncy',
ExpandColumn: 'name',
datatype: "local",
mtype: 'Get',
colNames: ['id','Name','MenuId','Menu Name'],
colModel: [
{name:'RowId',index:'RowId',width:300,fixed:true},
{name:'Name',index:'Name',width:300,fixed:true},
{name:'MenuId',index:'MenuId',width:300,fixed:true},
{name:'MenuName',index:'MenuName',width:300,fixed:true},
],
root:[
{id:"1",Name:"Main Menu", MenuId:"1",MenuName:"Menu1"},
{id:"2",Name:"Main Menu1",MenuId:"2",MenuName:"Menu2"},
{id:"3",Name:"Main Menu2",MenuId:"3",MenuName:"Menu3"}
],
pager: '#dvtreegridsamp',
Caption: 'Sample Tree View Model'
})
$("#treegridsamp").jqGrid('navGrid', '#dvtreegridsamp',
{ edit: false, add: false, del: false, search: false, refresh: false });
var mydata=[
{id:"1", Name:"Main Menu", MenuId:"1",MenuName:"Menu1"},
{id:"2", Name:"Main Menu1", MenuId:"2",MenuName:"Menu2"},
{id:"3", Name:"Main Menu2", MenuId:"3",MenuName:"Menu3"},
{id:"1.1", Name:"Sub Menu", MenuId:"1",MenuName:"Menu1"},
{id:"1.2", Name:"Sub Menu1", MenuId:"1",MenuName:"Menu1"},
{id:"1.1.1",Name:"Sub Sub Menu",MenuId:"1",MenuName:"Menu1"},
{id:"2.1", Name:"Main Menu", MenuId:"2",MenuName:"Menu2"},
{id:"2.2", Name:"Main Menu", MenuId:"2",MenuName:"Menu2"},
{id:"3.1", Name:"Main Menu", MenuId:"3",MenuName:"Menu3"},
{id:"3.2", Name:"Main Menu", MenuId:"3",MenuName:"Menu3"},
];
for(var i=0;i<mydata.length;i++) {
$("#treegridsamp").jqGrid('addRowData',i+1,mydata[i]);
}
Ext.us.tree.TreeGrid
andExt.ux.tree.TreeGridLoader
? Why you use$('#treegridsamp').jqgrid
and not$('#treegridsamp').jqGrid
? – Guayule$('#treegridsamp').jqgrid({treeGrid: true, treeGridModel: 'adjacecncy',...
you should use$('#treegridsamp').jqGrid({...
instead (jqGrid and not jqgrid). – GuayuleaddRowData
after the grid is defined. you should better use directlydata:mydata
parameter of jqGrid. TheRowId
column is undefined in your data. Do you want rename the column name toid
? – Guayule