Forum


18:49

26/05/2011

Hi,
again on Combobox/Form Editing.
I'm facing a question about combos, especially for searching values..
I have a decoding table, for ex. PAYMENT_TYPES with this values:
ID | TYPE
1 -> CASH
2 -> CREDIT CARD
And in my customer orders table I have those values:
ORDER_ID | NAME | PAYMENT_ID
567 -> SMITH -> 1
789 -> FOO -> 2
For showing Orders grid I'm using a MySql query that join IDs to show Text inside Grid (for ex. I will show "CASH" and not "1" when listing orders), but this will be a problem for searching because the filter refer to "CASH" and not 1
How to fix this? How to pass the query the correspondant ID, or how to let the grid to decode itself the IDs and show Values?
Thanks
Max
21:40

Moderators
30/10/2007

Hello,
I suppose you do not have time to read the documentation. Is this right?
What about if you look into the documentation for formatters and especially for for some type of build in formatter named select!
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:07

26/05/2011

Hi Tony,
no, it's not a lack of time...
The coltype for column Payment_id is declared in this way:
{name:'fk_id_payment',index:'fk_id_
payment
', editable: true,edittype:"select", editoptions:{value:"1:CASH;2:CREDIT CARD;"}},
But in my tests using all features I found always this result:
ORDER_ID | NAME | PAYMENT_ID
567 -> SMITH -> 1
789 -> FOO -> 2
If I can I will post a sample page with code to show you.
Thanks
Max
00:21

Moderators
30/10/2007

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.
11:13

26/05/2011

Hi Tony,
using this option "formatter:'select', " in the colmodel make the difference, now it show exactly the Value and not the ID; in my example it show "CREDIT CARD" and not "2".
OK, but the problem I'm getting now is for searching and for editing...
For searching: I am making search with the value and not the ID, I'm looking for all orders done with "CREDIT CARD" and the database contain an ID for this column, so the search string the user type contain "CREDIT CARD" and not "2" and no records can be found
For Editing: The grid actually show a combobox for the value, but it's not showing the current record value, it's showing the list from the beginning. If the order has been done with CREDIT CARD, it means it's the second value in the combo, however it always show "CASH" for any record I'm editing. For two elements will be not a problem, for many and many this could be a problem for the user memory....
Thanks
Max
Most Users Ever Online: 715
Currently Online:
75 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