Forum
20:50
04/08/2008
.... but post to the server as a key value.
Hi All,
When binding to a dropdown list my data has to contain the text of the dropdown versus the value of the dropdown. When the form posts back to the server it contains the value not the text. Anyway dropdowns can bind to the value instead of the text? or at least have a switch? I understand wanting both but the current implmentation mixes them together.
(Again I am total n00be!)
TIA
-Jon
We dont callit Eaves dropping we call it freedom listening.......
01:42
Moderators
30/10/2007
Jon,
What about keyvalue = text - I mean you can construct the dropdown to have the same values of key and text - If I understand right.
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.
19:18
04/08/2008
Hi Tony. When I supply the JSON data to the grid I send the dropdown text. When the user saves (I am using formedit -nice job BTW!) the value is sent back. It would be desirbale to not send the text but instead send teh value and have the form combo box bind to the value instead of the text. Hopefully that makes sense.
TIA
-Jon
tony said:
Jon,
What about keyvalue = text - I mean you can construct the dropdown to have the same values of key and text - If I understand right.
Regards
Tony
We dont callit Eaves dropping we call it freedom listening.......
02:55
Moderators
30/10/2007
Hi Jon,
I think that I do not undertstand something. So let me explain what I know.
To the grid you send the text of the combo - right?
You use formedit to change the values of that field.
But before doing this jqGrid should know what for values and text are
for this combo - right? This is done via editoptions:{value:"key1:value1;...
In other words you should construct editoptions value. This can be
done statically and dynamically depending on your needs - or simply
we should have the key before they is sended to the server.
My question is where are the keys for these combos?
Best
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.
05:15
01/08/2008
Hello,
Sorry to butt in on a post, but I was about to request the same feature. My drop down lists uses the database ID of a field for the select's value and a text field as it's text. The fact that jGrid returns the value is great as I can simply put the ID into the referencing object. However, I'm having to fudge some nasty look up code (a problem with my companies framework) in order to provide the text value in the cell to resolve the drop down. It would be much easier for me to be able to use the ID and have the drop down resolve using that.
Regards,
~Dan
P.S. Your suggest to use the text and the value element of the select is not really feasible as some of the names can be very long and are not guaranteed to be unique.
05:27
Moderators
30/10/2007
This is true only if the values in editoptions are static. In case of dynamic values in options this will not work since the engine will read the data, but the text are not redy yet.
Instead I will try to investigate this
Thank you
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.
10:27
Moderators
30/10/2007
Ok,
When the values are static here is a fragment on how to do that:
afterInsertRow : function(rowid,recdata){
var idtotext;
colid = 2; //the id of the column which holds the select begin from 0
switch (recdata.selectid){
case 'AB':
idtotext = 'ABTEXT';
break;
….
}
$(”#mygrid”).SetCell(rowid,colid,idtotext);
// when we use colid instead of colname this method is faster
}
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:
34 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