Forum


08:33

11/05/2009

hi,
one of my cols in the colModel contains a edittype:"select".
{name:'type',index:'type',width:160,align:"right",sorttype: "select",editable:true,formatter:'select',edittype:"select", editoptions:{value:"1:TypeA;2:TypeB;3:TypeC"}}
To fill the grid im using an array. Everything works fine, when i set the value to "2" "TypeB" is shown.
row example: {idDB:"${time.id}",type:"2")
The user can modify one or more rows and than he can hit my save button. When the hits the butten i want to send the data via DWR to my bean.
var idDB = new Array();
var type = new Array();
var dataIDs = grid.getDataIDs();
for(var i = 0; i < dataIDs.length; i++){
temp = grid.getRowData(dataIDs[i]);
idDB[i] = temp.idDB;
type[i] = temp.type; <--problem only the displayed value
}
ajaxTimeGridSave.saveDataFromGrid(idDB,type);
My problem is now, how can i get the value for the selected type? Because I have to send to my bean when "TypeC" is selected a "3".
Thanks
Arne
15:24

Moderators
30/10/2007

Hello,
It seems like you use custom editing of the grid data and not the build in form, cell or inline editing modules (where a key is posted and not the text).
Maybe you should construct your own array from
editoptions:{value:”1:TypeA;2:TypeB;3:TypeC”}
and pass the needed key before posting the data.
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:
86 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