1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    4
    Vote Rating
    0
    petr_snajdr is on a distinguished road

      0  

    Default 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:

    Code:
    {"data":  {   "country__name":    {     "name": "United States",      "id": 242  } }, "success": true}
    Combobox is initialized and I see "United States"
    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:

    Code:
    {"data":    {    "country__name":  242   }, "success": true}
    I see text "242" in combobox now. When I preload all data to combobox, there is a text: "United States".

    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

  2. #2
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,273
    Vote Rating
    81
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      0  

    Default


    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.png
    UI: Sencha Architect 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!

  3. #3
    Sencha User
    Join Date
    Mar 2011
    Posts
    4
    Vote Rating
    0
    petr_snajdr is on a distinguished road

      0  

    Default


    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

  4. #4
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,273
    Vote Rating
    81
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      0  

    Default


    No, single selection is ok but your example is too complex.
    Not really.
    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 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!

Thread Participants: 1