Forum
22:41
I'm working with editable rows and when I use getRowData on a row that contains a select it returns the option text where I require the option value
eg
<select>
<option value='1'>Value 1</option>
<option selected='selected' value='2'>Value 2</option>
</select>
I expect it to return '2' but instead its returning 'Value 2'
Is this a bug or do I need to get the value a different way?
Cheers
00:07
Moderators
30/10/2007
Hello,
This is true. In the grid we have the string, but not the value. The getRowData return what is in the column.
Use custom unformat function to do that - (I f you go to do this use the last development from GitHub or wait for some days.)
Regards
Tony
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:36
30/07/2009
Isnt there an oversight in $.unformat? All the built in formatters are handled there, except for “select”.
Also, shouldn't there be an equivalent to getRowData that /does/ unformat the data (or did I miss it)? I would have expected it to be the default… the data gets formatted when its put into the grid, shouldnt it be unformatted when you take it out? Formatting is pure presentation – Im normally interested in the data value, rarely how its being displayed.
Mark
11:21
Moderators
30/10/2007
Hello,
It is done. Will publish the fix tomorow in GitHub ( need some testing)
Best Regards
Tony
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.
22:56
30/07/2009
Im having problems with unformat and getRowData (using latest from github).
It looks to me like getRowData is broken, but perhaps Im missing something obvious.
getRowData calls: $.unformat($(this).html(),{colModel:$t.p.colModel[i]},i)
Note, the first parameter is the html contents of the cell, as a string.
But $.unformat then uses $(cellval).text() - which for me is always returning the empty string (since, in general cellval wont be a selector that matches anything on the page!).
Im guessing that getRowData should just pass in this (it fixes the problem for me)
Mark
17:15
07/04/2009
It looks like the first (cellval) argument of $.unformat() was changed from a string to a jQuery object or something, but not all the places where it is called have been updated. I guess it still works as long as the cell contents can be recognized by jQuery as an HTML fragment, but that's not usually going to be the case. It works for a select, which is probably what Tony's been working on most recently, but not for '' or 'foo', for example, and cell values like 'input' or 'body' are going to really mess things up. And I've been getting warnings when I have cells containing characters like '/' and '!' that are invalid in selectors.
I'm not sure what the fix is, but the first argument probably needs to be either the jQuery object corresponding to the cell (or maybe the DOM object), in which case it shouldn't be called "cellval", or a string with the contents of the cell, in which case $.unformat() needs to handle it differently.
10:20
Moderators
30/10/2007
Hello,
Thanks Mark. Thanks Keith.
It is true. Will be fixed.
Best Regards
Tony
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.
Most Users Ever Online: 715
Currently Online:
82 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