There are many errors in your code. The most important is the usage of key: true
for more as one column. One can see that you included the property in definition of two columns 'ac_n_quad'
and 'ac_n_circ'
. When jqGrid fill the grid it uses <table>
for the body of the grid, <tr>
for rows and <td>
for cells on the grid. It's important to understand that jqGrid always assign some id
attribute to every <tr>
(for rows). HTML don't permit to have duplicates of id
on one HTML page. If you use key: true
for some column then jqGrid assign internal option keyIndex
to the index of the column in colModel
array which has key: true
option. In your case I think that jqGrid will use the last column with key: true
. So the values from 'ac_n_circ'
column will be used as ids.
If you have duplicate values in 'ac_n_circ'
column then you will have many different very strange effects (which are distinguish in different web browsers). For example if you click on one row then another row could be selected. You can have also different strange effects during editing too.
Because you use prmNames: {ac_n_quad: "id"}
(it's also wrong. correct will be prmNames: {id: "ac_n_quad"}
) then I can suspect that ac_n_quad
is the real unique id. So you should use key: true
only in ac_n_quad
column and you have to remove the property from any other columns ('ac_n_circ'
).
Additionally you can reduce and simplify the code. Default values of properties of elements of colModel
are described in the documentation (see "Default" column in the table). For example default values of width
, align
, editable
are 150, "left" and false. You use align:'right', editable:true
in all columns and you use width:70
most frequently. So you can use
cmTemplate: { align: 'right', editable: true, width:70 }
instead of cmTemplate: { align: 'center', editable: true }
which you use now. It allows you to reduce colModel
to
colModel: [
{name:'ac_n_quad', width:110, key:true},
{name:'ac_l_circ', width:65},
{name:'ac_n_circ', width:120},
{name:'ac_fin_g', width:60},
{name:'ac_pot', width:55},
{name:'ac_volt', width:60},
{name:'ac_n_polos', width:100},
{name:'ac_t_prot', width:100},
{name:'ac_v_prot'},
{name:'ac_cabo', width:60},
{name:'ac_fd', width:55},
{name:'ac_fp', width:55},
{name:'ac_ctr', width:60},
{name:'ac_pot_a'},
{name:'ac_pot_b'},
{name:'ac_pot_c'},
{name:'ac_pos_1'},
{name:'ac_pos_2'},
{name:'ac_calc', width:65}
]
If you have index
value the same as the value of name
value you can skip index
. In the same way if you can skip colNames
if it contains only values of name
property of colModel
.