Forum


08:07

02/01/2009

I'd like to change the subgrid column icons to indicate the presence of subgrid data. I can test the value of a row cell to make that determination.
In version 3.4.2 the row data was present when addSubGridCell was called and I was able to change the graphic file depending on the state of a cell in a row.
With version 3.5.3 the icon is implemented through CSS so I'll have to select one of the many framework icons available. However, because of the new gridview functionality (I believe), the data is not set when addSubGridCell adds the html for the SubGrid cell.
Can you recommend a way of doing this that doesn't involve changing the jQgrid javascript files?
I thought I could loop through all the rows after the grid is created and replace the class for the SubGrid cell. If that was a viable method, how would I identify the cell and how would I change the class for the <span> that is set in addSubGridCell.
Thanks,
09:43

Moderators
30/10/2007

Hello Rob,
I think replacing the icons this way will not do the job.
jqGrid uses UI Theming and (not) sure we are a little limited.
I will think how to change this (something like in tree grid where this can be configured).
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.
09:44

02/01/2009

Thanks Tony,
I managed to do it in the following way on loadComplete.
(this grids displays only one month so the total number of rows is a minor consideration and they are not paged)
for every row in the grid {
var cp = $("#ETSMonth").getCell(rowid, 'flagcolumn');
switch (cp) {
case "Yes":
sgImg = "ui-icon ui-icon-check" ;break;
case "No":
sgImg = "ui-icon ui-icon-plus" ; break;
case "":
sgImg = "ui-icon ui-icon-close"; break;
};
var nn = "<a href='javascript:void(0);'><span class=' " + sgImg + "'></span></a>"
$("#ETSMonth").setCell(rid, "0", nn);
}
Most Users Ever Online: 715
Currently Online:
53 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