Forum
15:47
25/11/2011
Hi,
I am using v4.2.0 and have discovered an issue with the column custom formatter function. It appears that it can be called with two different parameter types for the rowObject param under different circumstances. Here is the documentation link for the function: http://www.trirand.com/jqgridw....._formatter
The function is defined to conform to the following:
function myformatter ( cellvalue, options, rowObject ) { // format the cellvalue to new format return new_formated_cellvalue; }
rowObject is supposed to be the data for the row, and when initally called always is. However, I am making the cell editable using using the select type in the colmodel definition like this:
{ name: 'state',
index: 'state',
editable: true,
edittype: 'select',
editoptions :
{
value : getSelectString()
},
formatter: function ( cellvalue, options, rowObject )
{
return "new value";},
},
The problem happens if I do the following:
- Start to edit the cell which creates a select object in the cell.
- Hit "esc" to cancel the edit, making the select disappear.
- At this point the formatter is called with a HTMLTableRowElement rather than a standard rowObject with the col values in it.
The offending caller is in the "setCell" method at line 3117 in the jquery.jqGrid.src.js. Specifically, these lines seem to be at fault:
var ind = $t.rows.namedItem(rowid); if (ind){ var tcell = $("td:eq("+pos+")",ind); if(nData !== "" || forceupd === true) { v = $t.formatter(rowid, nData, pos,ind,'edit');
Most Users Ever Online: 715
Currently Online:
48 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66