jayanta sarkar

jayanta sarkar

  • NA
  • 391
  • 0

how to display json data in jqtreegrid display

Oct 2 2012 6:28 AM
Hi all,

my probles is my jqgrid code is like this i need treegrid display data


//JGrid control code to show user listing

$("#userlisting").jqGrid({
treeGrid: true,
treeGridModel: "adjacency",
ExpandColumn: "UserName",
autowidth: true,
ExpandColClick: true,
treeIcons: { plus: 'ui-icon-circle-plus', minus: 'ui-icon-circle-minus', leaf: 'ui-icon-person' },

datatype: 'json',
mtype: 'post',
multiselect: false,
colNames: ['', 'ID', 'First Name', 'Last Name', 'User Name', 'Location', 'Customer', 'Locked', 'Login Status', 'CustomerID', 'LocationID', 'DepartmentID', 'IsDefault'],
colModel: [
{ name: 'Options', index: 'Options', width: 110, align: 'center' },
{ name: 'UserID', index: 'UserID', width: 0, align: 'center', hidden: true },
{ name: 'FirstName', index: 'FName', width: 80, align: 'center' },
{ name: 'LastName', index: 'LName', width: 80, align: 'center' },
{ name: 'UserName', index: 'UserName', width: 80, align: 'center' },
{ name: 'LocationName', index: 'LocationName', width: 140, align: 'center' },
{ name: 'CustomerName', index: 'CustomerName', width: 120, align: 'center' },
{ name: 'Locked', index: 'Locked', width: 0, align: 'center', hidden: true },
{ name: 'isLoggedIn', index: 'isLoggedIn', width: 0, hidden: true },
{ name: 'CustomerID', index: 'CustomerID', width: 0, hidden: true },
{ name: 'LocationID', index: 'LocationID', width: 0, hidden: true },
{ name: 'DepartmentID', index: 'DepartmentID', width: 0, hidden: true },
{ name: 'IsDefault', index: 'IsDefault', width: 0, hidden: true }
],
pager: jQuery('#pager'),
rowNum: 30,
height: 'auto',
width: 930,
loadingui: true,
rowList: [30, 60, 90, 120],
sortname: 'UserID',
sortorder: "asc",
gridComplete: function () {
var rowData = $("#userlisting").getDataIDs();
for (var i = 0; i < rowData.length; i++) {
if (jQuery("#userlisting").getCell(rowData[i], 7) == 'True') {
jQuery("#userlisting").setCell(rowData[i], 4, '', 'Login');
}
/* Changed by Amol to set colour of complete row*/
if (jQuery("#userlisting").getCell(rowData[i], 11) == 'True') {
$("#userlisting").jqGrid('setRowData', rowData[i], false, { color: '#347C17' });
}
}
}
});

how to call at MVC Controller please help me its very urgent send my mail address [email protected]

Answers (5)