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
How to get the class ?
04/02/2013
13:51
Avatar
federik1982
New Member
Members
Forum Posts: 2
Member Since:
04/02/2013
sp_UserOfflineSmall Offline

Hi all, i'm new to the forum and in jqgrid (and jquery too). So forgive me.

The issue: i would like to retrieve the class attribute from a jqgrid cell

The story: i have a jqgrid with checkboxes and i want to enable or disable those depending if the class "btn_disable" is found or not on a button on the same row.

So I thought , i could go in the loadComplete function and set a loop in all the jqgrid rows . And if in the column "X" the attribute class contain "btn_disable" then set disable on checkbox too.

I'm sorry i know i'm a newbie 🙂

04/02/2013
16:48
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

If I understand your problem correctly the best choice in your case is the usage of cellattr property of colModel. See the answer mor an example of such implementation. The reason is the following: jqGrid internally create the rows of the grid sequensially one after another. The property cellattr of colModel, rowattr callback and custom formatters allows you to influence how the cells and rows of the grid will be during creating of the element. Inside of loadComplete all the elements are already placed on the page. So every change of the element at the moment follows many additional recalculation inside of web browser. So modification of large grid can be really very very slow. See in the answer more detailed explanation of the reason.

Best regards
Oleg 

04/02/2013
17:20
Avatar
federik1982
New Member
Members
Forum Posts: 2
Member Since:
04/02/2013
sp_UserOfflineSmall Offline

Thanks for the quick answer but i think i cannot apply that solution so easily. I mean maybe I could if I could use at pleasure the code.

But this is the case:

I'm working on a project since few months and all the code is already done. Now  i'm doing an enhancement where the Client wants to have checkboxes on the jqgrid , enables only if the pre-existing  button on the column "X" is enabled.

Now alle the jqgrid are made with a parametric file .js and with java actions where all the attributres are filled and sent to the js in an object. So 99% of the columns are with custom formatters .  (And no i cannot destroy o rework half of the project)

The checkboxes don't. Those are made with the multiselect param set to true. Then i have no acces (or i think i don't have) to those cb in the java action where there is the if condition for the mentioned "leading" button. So the only solution i could thought (in my ignorance) was to wait for the jqgrid loading and then looking for the custom class "btn_disabled" setted or not on the button in the column "X".

It orrible i know. And i'm pretty disperate 🙂

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
49 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