Forum


08:58

03/02/2010

Hi,
My intent is to have a grid with dynamic number of columns and column header - read from a table depending on how many records the user enter.
All seems well except that the inline cell editing doesn't work if the Column Header has certain Characters eg: the phrase 'Function', or Special Chars like &, +, ^, ~.
The column headers shows the symbol correctly and the cells show the value correctly, .... just that when invoking the function afterSaveCell, the value portion becomes undefined.
Gist of my code is:
===========
$("#gridmain").jqGrid('GridUnload');
$("#gridmain").jqGrid('jqGridImport',
{ impurl:"getexamcolumnHOD.php?mode=list&level="+level+"&prev_sid="+prev_sid+"&year="+year+"&term="+term+"&class="+classid+"&tid="+tid,
imptype: "xml",
mtype: "POST",
importComplete:function(){
$("#gridmain").jqGrid('setGridParam',{afterSaveCell: function (rowid,celname,value,iRow,iCol){
//if decimal value, to round up to next integer with a customised function - otherwise to show value in uppercase as the value might be a grading.
if (value.indexOf(".")>=0) // error shown here stating value is undefined when viewed using firebug
{
value = roundNumber(value,1);
$("#gridmain").jqGrid('setCell',rowid,iCol,value,{});
}else{
value=value.toUpperCase();
}
// and finally to save the edited value to table using ajax.
ajaxCall("saveexammarkdbHOD.php", "id="+rowid+"&val="+value+"&fullmark="+st+"&scid="+scid+"&level="+level+"&prev_sid="+prev_sid+"&year="+year +"&term="+term+"&class="+classid+"&tid="+tid,"forAjax");
}});
}
});
In getexamcolumnHOD.php, I code it to pull the neccessary cell values to display in the grid. I am having issue at:
<colNames>$descript</colNames>
Things are ok if $descript is a simple alphanumeric info. The column header display and the edited cell values get saved.
But when $descript contains &, ^, +, ~ and others special chars, the column header and the cell values are displayed correctly... but when the cell is being edited, the cell becomes blank and the grid hangs.
How to overcome having special chars in <colNames>? I need to at least allow the symbol &.
Thanks.
17:28

Moderators
30/10/2007

Hello,
Yes this is true. The name from colModel is the name in form.
For the allowed characters for the name attribute you can look here:
http://www.razzed.com/2009/01/.....n-htmlxml/
or here
http://www.razzed.com/2009/01/.....n-htmlxml/
That is chars listed from you are not acceptable in the name attributte
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
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