Is it possible to search locally in jqGrid with treeGrid installed

Posted by Nehu on Stack Overflow See other posts from Stack Overflow or by Nehu
Published on 2012-03-29T11:26:55Z Indexed on 2012/03/29 11:30 UTC
Read the original article Hit count: 390

Filed under:
|

I am using jqGrid with treeGrid. I have added a filterToolbar. I would like to search locally instead of having a server call. The treegrid docs say that, "When we initialize the grid and the data is read, the datatype is automatically set to local."

So, is it possible to implement local search with treeGrid. I tried the below configuration, but it is resulting in server calls.

My Configuration is

var grid = $("#grid").jqGrid({
    treeGrid: true,
    treeGridModel: 'adjacency',
    ExpandColumn: 'businessAreaName',
    ExpandColClick : true,
    url:'agileProgramme/records.do',
    datatype: 'json',
    mtype: 'GET',
    colNames:['Id'
              , 'Business Area'
              , 'Investment'
              , 'Org'
              , 'Goal'
    ],
    colModel:[
/*00*/          {name:'agileProgrammeId',index:'agileProgrammeId', width:0, editable:false,hidden:true},
/*01*/          {name:'businessAreaName',index:'businessAreaName', width:160, editable:false},
/*02*/          {name:'programmeName',index:'programmeName', width:150, editable:false, classes:'link'},
/*03*/          {name:'org',index:'org', width:50, editable:false, classes:'orgHierarchy', sortable : false},
/*04*/          {name:'goal',index:'goal', width:70, editable:false}
    ],
    treeReader : {
        level_field: "level",
        parent_id_field: "parent", 
        leaf_field: "leaf",
        expanded_field: "expanded"
    },
    autowidth: true,
    height: 240,
    pager: '#pager',
    sortname: 'id',
    sortorder: "asc",
    toolbar:[true,"top"],
    caption:"TableGridDemo",
    emptyrecords: "Empty records",
    jsonReader : {
        root: "rows",
        page: "page",
        total: "total",
        records: "records",
        repeatitems: false,
        cell: "cell",
        id: "agileProgrammeId"
    }
});   

And to implement the search toolbar

$('#grid').jqGrid('filterToolbar', {stringResult: true,searchOnEnter : true});

Would appreciate any help or any pointer on even if it is possible?

© Stack Overflow or respective owner

Related posts about jqgrid

Related posts about treegrid