-
6 Feb 2013 9:19 AM #1
Different behavior combobox in version 4.1
Different behavior combobox in version 4.1
Dear All,
I use remote JSON based store for xtype: combo in ExtJS 4.0.7. When the form is loaded, I create the JSON structure:
Combobox is initialized and I see "United States"Code:{"data": { "country__name": { "name": "United States", "id": 242 } }, "success": true}
If I repeat it in version 4.1, I see only text: "[object]"
OK, I try another way and change JSON for remote store to:
I see text "242" in combobox now. When I preload all data to combobox, there is a text: "United States".Code:{"data": { "country__name": 242 }, "success": true}
The problem is that the application can not load all the data to store - more than 40,000 rows ...
How to solve it?
When I use xtype: Ext.ux.form.field.BoxSelect
from https://github.com/kveeiv/extjs-boxselect,
BoxSelect create an AJAX request to the backend and load from remote store the relevant data.
But the xtype:combo works differently
Thank you
-
6 Feb 2013 12:34 PM #2
The problem is that the application can not load all the data to store - more than 40,000 rows ...
How to solve it?
I rely on combobox only for very small record set.
What I use in that situation is a trigger field + hidden field.
In the trigger field I render the description, name or whatever data is needed of the related entity/table.
In the hidden field I store the id (key) of the related entity/table.
In trigger click I show a window from which user can select the new value.
Example:
Selection_001.png
Regards.
EDIT: Sorry, It seems that you want MULTI-SELECT.
Use a dual list like this:
Selection_002.pngUI: Sencha Architect 2.x / ExtJS 4 MVC
Server side: EJB 3.1 / CDI / JPA 2 / JAX-RS / JasperReports
Application Server: Glassfish 3.1.x
Databases: Oracle 10g & 11g / DB2 9 & 10 / Firebird 2.5
If you like my answer please vote!
-
6 Feb 2013 10:38 PM #3
No, single selection is ok but your example is too complex.
I look same or simiar functionallity as in version 4.0.7 - simple load default value.
In this situation, it is easier for me to use BoxSelect in single selection mode.
I am surprised that it is so difficult to find same solution for xtype:combo
Thank you for your help
-
7 Feb 2013 7:52 AM #4
Not really.No, single selection is ok but your example is too complex.
What you should have in mind is that this scenario is likely to be repeated in the future.
You mention a 40k records.
Do you will load 40k in the client side to avoid "complexity"?
Suppose you are writing and invoicing form and you need to select the customer to be invoiced and you have hundreds, thousands even millions of them and you need not only create a new invoice but edit them.
Do you will use a combo solution?
Then, the application grows and now you craft a new form in which user inputs customer code then show its invoices. You need again a way to look up for a customer.
As I said, combobox is nice for few records (few tent IMO), but for larger data sets you need different approach.
Regards.UI: Sencha Architect 2.x / ExtJS 4 MVC
Server side: EJB 3.1 / CDI / JPA 2 / JAX-RS / JasperReports
Application Server: Glassfish 3.1.x
Databases: Oracle 10g & 11g / DB2 9 & 10 / Firebird 2.5
If you like my answer please vote!


Reply With Quote