2010-09-23 136 views
0

我的jqGrid似乎沒有重裝..任何人都可以幫我嗎?..問題的jqGrid

$(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"     
}); 

回答

0

您應該使用

pager: '#pager2', 

loadonce: false, 

希望這幫助你。