2013-08-05 41 views
0

使用JqGrid,我只是試圖實現一個複選框字段,該字段每次用戶選中/取消選中時都會使用ajax請求更新數據庫數據。這是我的失敗嘗試:JqGrid複選框字段實現失敗

{name:'fastpass',index:'fastpass',width:20,editable:true, edittype:'checkbox', editoptions:{ 
value:"True:False", 
dataEvents:[{ 
type:'click',fn:function(e){ 
alert(); 
} 
}] 
}, formatter:"checkbox", formatoptions:{disabled:false} } 

但我似乎無法弄清楚我做錯了沒有得到alert()。代碼有什麼問題?

回答

0

試試這個

  { name: 'fastpass', 
       index: 'fastpass', 
       width: 20, 
       editable: true, 
       edittype: 'checkbox', 
       editoptions: { 
        value: "True:False", 
        dataEvents: [{ 
         type: 'click', fn: function (e) { 
          alert(); 
         } 
        }], 
        formatter: "checkbox", 
       }, 
       formatoptions: { disabled: false } 
      } 
+0

是不是它本質上是一回事嗎? –

+0

令人驚訝的是,這個甚至沒有顯示覆選框。 –