2011-05-27 186 views
1

我是jqgrid的新手,我不知道jqgrid是如何工作的。 我在我的網格中有一個搜索圖標,但當我想要過濾一些數據時它不起作用。 下面我後我的網格:jqGrid搜索不起作用

jQuery("#list").jqGrid({ 
         url:'dounfinish.php', 
         datatype: 'json', 
         mtype: 'POST', 
         colNames:['id','Date', 'Line'], 
         colModel :[ 
            {name:'def_id',index:'def_id', hidden:true, width:55}, 
            {name:'Problem_date', index:'Problem_date', width:90, editable:true}, 
            {name:'Line', index:'Line', width:80, align:'right', editable:true, search:true}, 
            ], 
         pager: jQuery('#pager'), 
         rowNum:10, 
         rowList:[10,20,30], 
         sortname: 'Problem_date', 
         sortorder: "desc", 
         viewrecords: true, 
         imgpath: 'themes/basic/images', 
         caption: 'OQC DEFECT DATA' 
         }); 
jQuery("#list").jqGrid('navGrid','#pager',{edit:true,add:false,del:false}); 

我應該怎麼改變,使搜索過程的工作?

回答

0

你試過看看search wiki?它看起來像你的列定義應該看起來像這樣:

colModel: [ 
     ... 
     {name:'price', index:'price', width:60, search:true, stype:'text', searchoptions:{dataInit:datePick, attr:{title:'Select Date'}} }, 
     ... 
    ] 
+0

指我的網格如何更改'dataInit'? – nunu 2011-05-27 03:35:56

+0

你看過維基? – 2011-05-27 03:51:31

+0

是的,我did.but仍然混淆如何實施到我的網格。在維基中沒有圖片。 – nunu 2011-05-27 04:04:03