2011-09-06 136 views
0

我的jqgrid出現問題。我創建了一個從數據庫中調用值的下拉框,所以我在我的colmod中使用以下語法。JqGrid未顯示下拉框

{name:'brate_id',index:'brate_id',width:100,formatter:"select",edittype:"select",editoptions:value:<?=json_encode($brate_list)?>} ,editable: true},

我brate_list是

$brate_list = $employee->get_table_for_dropdown('hr_basic_rate','brate_id','rate_hcode');

看來,當我把格式化它不顯示我的下拉框,除非我點擊單元格,選擇它。但是,當我刪除我的格式化它顯示下拉框,但當我保存數據時,它發送錯誤的數據類型

(例如,當我從數據庫傳遞值我將Y轉換爲是,所以當它出現在下拉框它是「是」,所以當我嘗試使用格式化程序保存數據時,它將發送Y.但是,如果格式化程序被刪除,它將向數據庫發送「是」,而其變爲空)。

有沒有辦法顯示jqgrid中的下拉框而不影響其保存和格式?

回答

1

我相信editoptions:value:應該有一個{之前是這樣的:editoptions: { value:

希望這有助於!

{name:'brate_id',index:'brate_id',width:100,formatter:"select",edittype:"select",editoptions: { value: <?=json_encode($brate_list)?>} ,editable: true},