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
Combo Select Values: Simple Search
26/05/2011
18:49
Avatar
p2pow350
Member
Members
Forum Posts: 32
Member Since:
26/05/2011
sp_UserOfflineSmall Offline

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

26/05/2011
21:40
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

26/05/2011
22:07
Avatar
p2pow350
Member
Members
Forum Posts: 32
Member Since:
26/05/2011
sp_UserOfflineSmall Offline

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

27/05/2011
00:21
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

27/05/2011
11:13
Avatar
p2pow350
Member
Members
Forum Posts: 32
Member Since:
26/05/2011
sp_UserOfflineSmall Offline

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

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information