Forum


07:43

08/10/2008

I've worked a lot with the EXTJS grid, and one of the things I've come to love is the "renderer" functionality for a cell. This provides an easy way to do custom cell formatting. Basically, in the columnmodel, you specify a renderer. this is a javascript function that you write.
the grid, when it sees a custom renderer is attached, passes the contents of the grid through the renderer function, passing in the cell value, the json object for that entire row, and some other stuff.
in this way, you can do dollar formatting, turn 1/0 into yes/no, and all kinds of other goodness.
Does jqGrid have this kind of custom cell formatting functionality?
thanks.
Marc
07:59

Moderators
30/10/2007

Hello,
It is not direct cell renderer but requires some little code.
Imagine we must known the input and output format for that cell -
(what we expect and what we put)
The reason that I do not put such renderer is the complexity and at first time the speed, but jqGrid have a lot of methods to do that.
use afterInsertRow event again with setCell method and you can do what you want here.
afterInsertRow : fiunction (rowid, adata) {
if( some_condition ) {
jQuery("#gridid").setCell(rowid,'cellname',myformater(adata.cellname));
}
}
function myformater(input) {
// do something here
return new_formated_value
}
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:
97 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