views:

6

answers:

0

my jqgrid doesnt seem to reload.. can anyone help me with this?..

 $(function(){
    $last_name = $("#search_last_name").val();
    $first_name = $("#search_first_name").val(); 
 });
 $("#search").click(function(){
    jQuery("#list2").jqGrid('setGridParam',{url:"http://localhost/bcb/index.php/bcb_c/grid"});
    jQuery("#list2").trigger("reloadGrid");
});

$("#list2").jqGrid({
    url:'http://localhost/bcb/index.php/bcb_c/grid',
    datatype: "json",
    colNames:['id','First Name','Middle Name', 'Last Name', 'Address'],
    colModel:[
        {name: 'id', index:'id', width:20},
        {name:'first_name',index:'first_name', width:120},
        {name:'middle_name',index:'middle_name', width:120},
        {name:'last_name',index:'last_name', width:120},
        {name:'address', index:'address', width:120}
    ],
    rowNum:10,
    rowList:[10,20,30],
    loadonce: true,
    postData: {pass1: $last_name, pass2: $first_name},
    pager: jQuery('#pager2'),
    width: '550',
    imgpath: gridimgpath,
    scrollrows: true,
    viewrecords: true,
    sortorder: "desc"                 
});