Results 1 to 5 of 5

Thread: [MODERN] selectfield won't bind properly to numeric values

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1

    Default [MODERN] selectfield won't bind properly to numeric values

    Hi,

    This fiddle reproduces the problem:



    To reproduce, just pick a person in the first combo, and see how the second field changes to [object object].

    When binding a "selectfield" to a numeric value, it is initially properly set: it sets the proper record from the value field. But when changing the value with the select, it then sets and publishes the record itself. This invalidates using "selectfields" in many scenarios (such as setting foreign key values). It doesn't happen in classic.

    I know that I could bind the combo to "{selectedPerson}" and this example would work, but I am interested in using the combo to change numeric values (foreign keys) in other records. As mentioned, that works in classic.

    Thanks

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379

    Default

    Instead of binding the selectfield to '{selectedPerson.id}', change it to be '{selectedPerson}':

    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3

    Default

    Thanks Mitchell,


    Yep, I know that fixes the example (I pointed it out in my original post indeed):


    I know that I could bind the combo to "{selectedPerson}" and this example would work, but I am interested in using the combo to change numeric values (foreign keys) in other records. As mentioned, that works in classic.
    But this doesn't fix my use case: setting a foreign key in the record I am editing. In classic I can do that. But with modern I can't. Any hint on this?

  4. #4
    Sencha Premium Member
    Join Date
    Oct 2010
    Posts
    99

    Default

    Hi,

    I have similar problem with binding of select field on Modern toolkit. Binding seems to bind Model, not value. In my example I want to set invoice object's invoiceCustomerAbbr Property from selected Contact's contactAbbr. Instead it binds selected Contact object to invoice. ValueField property is correctly set to contactAbbr on select field.


  5. #5
    Sencha Premium Member
    Join Date
    Jun 2007
    Location
    Oslo,Norway
    Posts
    659

    Default

    This issue should be opened again. It's easy to reproduce and still a problem (6.0.1)

    When creating a form:
    e.g. Order, and I want to include two select fields, one for Contact, and one for Projects, I'm not able to use binding

Similar Threads

  1. [CLOSED] Ext.dom.Element.setVisible not working properly in modern toolkit
    By movys in forum Ext JS 6.x Bugs
    Replies: 2
    Last Post: 6 Aug 2015, 1:43 AM
  2. Non numeric values in numeric axis
    By prakashpaudel in forum Sencha Ext JS Q&A
    Replies: 2
    Last Post: 27 Jan 2014, 1:52 AM
  3. [CLOSED] [2.0.1.1] Selectfield with numeric valueField
    By hotdp in forum Sencha Touch 2.x: Bugs
    Replies: 9
    Last Post: 29 Aug 2012, 8:22 AM
  4. xtype: selectfield seems to not work properly if values in the option are identical
    By Armandhammer in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 24 Aug 2012, 2:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •