1. #1
    Sencha User
    Join Date
    Jan 2012
    Location
    Switzerland
    Posts
    15
    Vote Rating
    0
    hciftci is on a distinguished road

      0  

    Default Display combined values in Combobox

    Display combined values in Combobox


    Hi
    In my architect project I have a form with a combo box. The value field is set to id, but I would like to set the display field to the models first name + last name field. How can I do that within Sencha Architect?

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,308
    Vote Rating
    125
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Use a template in the ComboBox
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Location
    Switzerland
    Posts
    15
    Vote Rating
    0
    hciftci is on a distinguished road

      0  

    Default


    Thank you for your response. Can you provide an example?

  4. #4
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,308
    Vote Rating
    125
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Attached is a simple example showing overriding the inner template used by the bound list in the combobox.
    combotpl.xda

    In terms of interface, this is much more challenging than we'd like it to be at this time. We'll work on that.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  5. #5
    Sencha User
    Join Date
    Jan 2012
    Location
    Switzerland
    Posts
    15
    Vote Rating
    0
    hciftci is on a distinguished road

      0  

    Default


    The provided example show both values, first and last name. But I have the issue that you can't select a value. Can you help me with this? I copied 1:1 from your example into my project.

    PS: The valueField is numeric whereas the displayed items are not.

  6. #6
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,308
    Vote Rating
    125
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Sounds like a better approach for your particular situation would be using an additional field with a calculated value via a convert function.

    I've attached an example that illustrates how to do this.
    combo.xda
    Aaron Conran
    @aconran
    Sencha Architect Development Team

Thread Participants: 1