私は今jqGridから始めていますが、理解できない問題がいくつかあります。グリッドをインライン編集できるようにしていますが、1行目を編集するだけです。いずれかの行をクリックすると、最初の行だけが編集されます。何が起こっているのかわかりません。誰かがそれを段階的に行う方法を教えてくれれば、それは私に大いに役立つでしょう。
これは私のコードの一部です:
$(function(){
var lastSel;
$("#list").jqGrid({
url:'php.php',
datatype: 'xml',
mtype: 'POST',
colNames:['ac_n_quad', 'ac_l_circ', 'ac_n_circ', 'ac_fin_g', 'ac_pot', 'ac_volt', 'ac_n_polos', 'ac_t_prot', 'ac_v_prot', 'ac_cabo',
'ac_fd', 'ac_fp', 'ac_ctr', 'ac_pot_a', 'ac_pot_b', 'ac_pot_c', 'ac_pos_1', 'ac_pos_2', 'ac_calc'],
colModel :[
{name:'ac_n_quad', index:'ac_n_quad', width:110, align:'right', editable:true, key:true},
{name:'ac_l_circ', index:'ac_l_circ', width:65, align:'right', editable:true},
{name:'ac_n_circ', index:'ac_n_circ', width:120, align:'right', editable:true, key: true},
{name:'ac_fin_g', index:'ac_fin_g', width:60, align:'right', editable:true},
{name:'ac_pot', index:'ac_pot', width:55, align:'right', editable:true},
{name:'ac_volt', index:'ac_volt', width:60, align:'right', editable:true},
{name:'ac_n_polos', index:'ac_n_polos', width:100, align:'right', editable:true},
{name:'ac_t_prot', index:'ac_t_prot', width:100, align:'right', editable:true},
{name:'ac_v_prot', index:'ac_v_prot', width:70, align:'right', editable:true},
{name:'ac_cabo', index:'ac_cabo', width:60, align:'right', editable:true},
{name:'ac_fd', index:'ac_fd', width:55, align:'right', editable:true},
{name:'ac_fp', index:'ac_fp', width:55, align:'right', editable:true},
{name:'ac_ctr', index:'ac_ctr', width:60, align:'right', editable:true},
{name:'ac_pot_a', index:'ac_pot_a', width:70, align:'right', editable:true},
{name:'ac_pot_b', index:'ac_pot_b', width:70, align:'right', editable:true},
{name:'ac_pot_c', index:'ac_pot_c', width:70, align:'right', editable:true},
{name:'ac_pos_1', index:'ac_pos_1', width:70, align:'right', editable:true},
{name:'ac_pos_2', index:'ac_pos_2', width:70, align:'right', editable:true},
{name:'ac_calc', index:'ac_calc', width:65, align:'right', editable:true}],
cmTemplate: { align: 'center', editable: true },
onSelectRow: function(id){
if(id && id !== lastSel){
$(this).restoreRow(lastSel);
lastSel = id;
}
$(this).editRow (id, true);
},
prmNames: {ac_n_quad: "id"},
editurl:'clientArray',
autowidth: 'true',
height: 'auto',
rowNum: 10,
rowList: [10,20,30, 40, 50, 60, 70, 80, 90, 100],
sortname: 'ac_n_quad, ac_n_circ',
sortorder: 'asc',
pager: '#pager',
viewrecords: true,
gridview: true,
caption: 'Table circ_69'
});
jQuery('#list').jqGrid('gridResize');
jQuery('#list').jqGrid('navGrid', '#pager', {
edit: true,
add: true,
del: true,
search: false,
refresh: false
});
});