Jqgrid Treegrid reloading a node on updating the local source data

I have created a Treegrid with local data

$("#historyGrid").jqGrid({
    datatype: "jsonstring",
    datastr : treeGridObject ,
    colNames:["Id","Channel","Current","History","Delta"],
    colModel:[
        {name:'id', index:'Id', width:120, hidden : true , key:true},
        {name:'channel', index:'Name', width:180},
        {name:'current', index:'Current', width:80},
        {name:'history', index:'History', width:80},
        {name:'delta', index:'Delta', width:80}

    ],
   height: 'auto'  ,
    gridview: true,
    rowNum: 10000,
    sortname: 'id',
    treeGrid: true,
    treeGridModel: 'adjacency',
    treedatatype: "local" ,
    ExpandColumn: 'channel' ,

    treeReader: {
        level_field: "level",
        leaf_field: "isLeaf",
        expanded_field  : "expanded"

      }

});

I have to add child nodes on clicking a particular parent node loaded dynamically . For this what should I do after updating the local source data

Right now I am calling the below line after updating the source data ( adding row info ) . It seems this reloads the whole treegrid . Is there a way I can reload only the node I clicked ?

$("#historyGrid")[0].addJSONData({
                       total: 1,
                       page: 1,
                       records: treeGridObject.length,
                       rows: treeGridObject
                   });

I have already tried $("#historyGrid").addChildNode(treeGridRow.id , rc._id_ , treeGridRow); This doesnt work .

Problem courtesy of: Bill Goldberg

我来评几句
登录后评论

已发表评论数()

相关站点

+订阅
热门文章