Forum
17:20
18/11/2008
This question has been asked in a number of ways, but I don't find the answers to be quite what I am looking for:
"Is there a way to change a cell's properties within a custom formatter?"
What I really want to know, though, is if there is a way to add or access a specific cell's HTML properties at the time the formatter is being run. The issue I have is that I want to change the class attribute of a cell based on it's formatted value, but to draw the row, and then go back and process each cell and their values seems to be redundant and very inefficient.
Is there some way of interacting with the rowObject or a specific cell while in a Custom Formatter (either through setCell or manually) that will allow me to change the HTML result that is written to the DOM for the specific cell it is attached to?
It seems as though there must be a way to access the jqGrid object within the formatter before the DOM is written, but while a formatter is being executed on a cell. Has anyone successfully done this?
15:59
09/01/2011
+1 for this feature request.
jqGrid is a great component.
I would really like to see in jqGrid API an option for custom formater to be the function receiving curren cell DOM.
Example of usage:
function customFormatter(cell)
{
$(cell).click(function() {
// do some advanced stuff here
})
}
The point is to be able to attach to javascript events. I want to avoid the formatter to render html content that contains function names. I want my fuction to be anonymous.
Most Users Ever Online: 715
Currently Online:
42 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