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
getRowData and select columns
01/10/2009
14:30
Avatar
Pete
Member
Members
Forum Posts: 100
Member Since:
01/09/2008
sp_UserOfflineSmall Offline

There have been a few posts about this and since I have run up against the same problem I'd like encourge a more permanent solution.

The problem is that when you call getRowData on a row that that has "select" columns, you get the full html returned rather than *just* the values the the select columns have selected.  So my first question is: Is there a better way to retrieve the actual values from a row containing select colums?  This is an inline editing model and in order to save the record, I need to have both the original values of the row and the changed values.  I get the original values with getGridParam('savedRow') and I'd like to be able to call something that produces the same fomatted output for the current row [ something like getGridParam('curentRow') would be great!]

I tried to walk through the getRowData code and fully understand what it was doing so that I could create something like a getRowValues method that would just return the values in each cell rather than all the HTML for the selects but my javascript skills are poor enough that I wasn't successful.

I have a hack that I use at the moment to work around the differences, but it is pretty fragile and won't work in all situations.

Is there a better way to retrieve just the values of the cells in the row?  I have 7 columns, all selects, that are in this grid and I need the individual values because the 7 columns represent the key to the record, which I need to retrieve and update the table. Again, getGridParam('savedRow') does just what I want for the original row, I need the exact same value returned for the *current* row. I need a "generic" solution since I have many grids that have to be maintained in the same way.

Thanks,

Pete

03/10/2009
03:36
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Use formatter:'select' and you will have what you want.

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.

08/10/2009
17:21
Avatar
Pete
Member
Members
Forum Posts: 100
Member Since:
01/09/2008
sp_UserOfflineSmall Offline

Actually, I DO have formatter:'select' on each column of the colModel for the grid but when I use the getRowData method passing the rowid that I need, I get HTML rather than just the selected values in the cells.  I pulled jqgrid from Github on September 27th.  Has there been an update or fix since then?

colModel looks like this:

  colModel:[
   {name:'positionLocation',index:'positionLocation', width:100, editable:true,edittype:"select",formatter:'select',editoptions:colLocations},
   {name:'criteria1',index:'criteria1', width:100, editable:true,edittype:"select",formatter:'select',editoptions:column1Values},
   {name:'criteria2',index:'criteria2', width:100, editable:true,edittype:"select",formatter:'select',editoptions:column2Values},
   {name:'criteria3',index:'criteria3', width:100, editable:true,edittype:"select",formatter:'select',editoptions:column3Values},
   {name:'criteria4',index:'criteria4', width:100, editable:true,edittype:"select",formatter:'select',editoptions:column4Values},
   {name:'criteria5',index:'criteria5', width:100, editable:true,edittype:"select",formatter:'select',editoptions:column5Values},
   {name:'gradeMin',index:'gradeMin', width:100, editable:true,edittype:"select",formatter:'select',editoptions:columnGradeValues},
   {name:'gradeMax',index:'gradeMax', width:100, editable:true,edittype:"select",formatter:'select',editoptions:columnGradeValues}
   ],

When I call getRowData it returns an object that has each column in it and the column values are the HTML select strings, not just the value of each selected column.

Maybe I missed something but I don't see it in the code here.

Thanks,

Pete

09/10/2009
04:17
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Which version do you use?

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/10/2009
11:37
Avatar
Pete
Member
Members
Forum Posts: 100
Member Since:
01/09/2008
sp_UserOfflineSmall Offline

The version from Git hub that was available on September 27th.  I don't see a text file that tracks the versioning that is current in Git Hub.  It is a 3.5.x version though.  The last "packaged" version on your site was 3.5.3 and I have pulled the latest version from Git Hub since then.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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