我已经尝试过 gridview:ture , loadui:block 但加载后显示 treegrid 仍然需要更多时间。我的 json 包含超过 2044 个数据。我正在使用 Firefox 3.6 版
我的代码如下
**
Glcm= [{name:'id',index:'id', label:'Id',hidden:true,key:true, Enabled:false,jsonmap:"id"},{name:'text',index:'text',label:'Global Ledger',width:400,jsonmap:"text",formatter:gLCheckbox},{name:'additionalInfo',index:'additionalInfo',label:'additionalInfo',hidden:true,jsonmap:"additionalInfo"},
],
**
GlTree.jqGrid({
url: 'GlTreeStructure.action',
datatype: "json",
mtype: "POST",
colModel:Glcm,
width:outerwidthGL,
height:300,
rowNum:-1,
pager: '#ptreeList',
viewrecords: true,
caption:"Global Ledger",
toolbar: [true,"top"],
gridview:true,
treeGrid: true,
pginput:false,
pgtext:"",
pgbuttons:false,
loadui:'block',
deepempty:true,
ignoreCase: true,
autoencode:true,
jsonReader :{root: 'glList',
cell:"",
repeatitems: false
},
treeReader : {
level_field: "level",
left_field:"lft",
right_field: "rgt",
leaf_field: "isLeaf",
parent_id_field: "parentId",
expanded_field: "expanded",
loaded: "loaded"
},
treedatatype: "json",
treeGridModel:'adjacency',
ExpandColClick: true,
loadonce:true,
ExpandColumn : 'text',
// cellSubmit: 'remote',
gridComplete:function()
{
myData = GlTree.jqGrid('getRowData');
}
});
// 此函数在格式化程序中用于显示单选按钮
function gLCheckbox(amount,options,rData)
{
if(rData.additionalInfo === 'G')
return '<div id ="checkglId"><input type="radio" id="radioId" name ="radioName" value="' +rData.text+'" align = "center",offval="off" onclick="selectGLElement(\''+rData.id+'\');" /> '+amount + '</div>';
else
return amount;
}