2
我有以下的內聯編輯網格閱讀編輯輸入值的jqGrid
var lastsel; $("#mygrid").jqGrid({ data:JqgridResponse.rows, datatype: "local", colNames:['DATE', 'SOURCE', 'DEST', 'FROM', 'TO'], colModel:[ //1140 width {name:'time', index:'time', width:170 ,sortable:false}, {name:'source', index:'source', width:290,sortable:false,editable:true,editoptions:{size:"33",maxlength:"50"}}, {name:'dest', index:'dest', width:290,sortable:false,editable:true,editoptions:{size:"33",maxlength:"50"}}, {name:'from', index:'from', width:170,sortable:false,editable:true, edittype:"select",editoptions:{value:"us:US;gb:GB;fr:FR"}}, {name:'to', index:'to', width:170,sortable:false,editable:true, edittype:"select",editoptions:{value:"us:US;gb:GB;fr:FR"}} ], multiselect: true, rownumbers: false, rowNum:10, rowList:[10,50,100], height: "100%", autowidth: true, pager: '#pager', viewrecords: true, sortorder: "desc", ondblClickRow: function(id) { if(id && id!==lastsel){ jQuery('#mygrid').jqGrid('restoreRow',lastsel); jQuery('#mygrid').jqGrid('editRow',id,true); lastsel=id; } } });
和導航按鈕,它的事件
$("#mygrid").navButtonAdd('#pager', { caption:"", buttonicon:"ui-icon-disk", onClickButton: updateLocations, title:"Update Locations", cursor: "pointer" } ); function updateLocations(obj, args){ //how to get the edited data source, dest, from, to ? }
我怎麼能得到的「源編輯的輸入值「和」dest「,並在updateLocations方法中選擇」from「和」to「的值?
我試圖找到編輯的行在Firebug,但輸入沒有任何值!例如對於「來源」
<td aria-describedby="mygrid_source" title="N-finger" style="" role="gridcell"> <input id="36_source" class="editable" type="text" size="33" maxlength="50" name="sourcespan" role="textbox"> </td>
我錯過了什麼嗎?謝謝。