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
Get cell value during grid load
22/09/2010
08:53
Avatar
bablaza
New Member
Members
Forum Posts: 1
Member Since:
21/09/2010
sp_UserOfflineSmall Offline

I want to create a custom formatter for which the format of the cell is based on another cell in the same row.

For example, don't show a checkbox unless there is a certain name in another column. Or create a "mailto" link on a name where a different column is used for the subject value.

In my formatter, I try to use getCell or getRowData to look at another column's data, passing in options.rowid and the appropriate column name. But it always returns "undefined" or "false". Making the same call after the grid is loaded returns the correct value. So I'm guessing that that the grid data isn't available while the grid is being built.

So how can my formatter access the value in a different column?

For the purposes of this exercise, assume I have a column named "manager", and a checkbox column names "complete". The checkbox should only be displayed if there is a certain name in the "manager" column.

02/11/2010
04:29
Avatar
liny
Member
Members
Forum Posts: 5
Member Since:
29/10/2010
sp_UserOfflineSmall Offline

Hi,

You can use below example in your customized formatter function:

formatter:function(cellvalue, options, rowObject){
                                         alert(rowObject['anotherColumnName']);
                                         return cellvalue;
                                     }

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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