Forum


14:30

01/09/2008

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:36

Moderators
30/10/2007

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.
17:21

01/09/2008

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
04:17

Moderators
30/10/2007

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.
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66