The formatter for txtVAlue
column don't use cellValue
. To fix the code of the formatter you can use something like
{
name: 'txtVAlue',
width: 40,
align: 'center',
formatter: function (cellValue, option) {
return '<input type="text" size="7" name="txtBox" id="txt_' + option.rowId +
'" value="' + cellValue +'"/>';
}
}
After the <input>
elements will be created correctly you should probably define the event handle which saves the changes in the inputs. You cab do the binding inside of loadComplete
callback for example. Additionally you should consider to implement onSortCol
callback. It will be called before the grid will be sorted (if the user clicks on the column header).
Additionally you should
- include closing
'
to all'#g
(replace it to'#g'
).Name
,ID
androwID
should be enclosed in'
too (or the variables should be declared and assigned). - you have to use another selector for
pager
as the id of the grid. For examplepager: '#g_pager
. The div withid="g_pager"
should be placed somewhere. - I recommend you to use
gridview: true
andautoencode: true
options.