Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Changing Subgrid column icons.
12/09/2009
08:07
Avatar
RobGMiller
Member
Members
Forum Posts: 42
Member Since:
02/01/2009
sp_UserOfflineSmall Offline

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,

12/09/2009
09:43
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

14/09/2009
09:44
Avatar
RobGMiller
Member
Members
Forum Posts: 42
Member Since:
02/01/2009
sp_UserOfflineSmall Offline

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);

}

I am guessing that because the subGrid selector column is not part of colModel, getCell or setCell operates on the HTML which would normally contain the cell data. 
Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information