Results 1 to 4 of 4

Thread: How to map button toggle groups automatically to specific field in form record

  1. #1
    Sencha Premium Member
    Join Date
    Sep 2011
    Posts
    51

    Default How to map button toggle groups automatically to specific field in form record

    I have a set of toggle buttons in a single "toggleGroup" within a form. Conceptually, all 3 buttons correspond to a single "alignment" field in the model backing the form. Thus, I'd like a value corresponding to the pressed button to (i.e., "left", "center" or "right") to be associated with the Model field automatically when the button is pressed. Is this possible? I realize I could put code in the toggle button handler that puts the appropriate value in the single model field, but it seems that this is a common enough situation that there would be an automatic way to accomplish it...

    Thanks,
    Brett S.

  2. #2
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Answers
    505

    Default

    Hi,

    You can listen to the toggle event from all buttons in the group like in the example below:


  3. #3
    Sencha Premium Member
    Join Date
    Sep 2011
    Posts
    51

    Default

    Quote Originally Posted by slemmon View Post
    Hi,

    You can listen to the toggle event from all buttons in the group like in the example below:

    Thanks. Yes. I knew I could set the field manually in the toggle handler, but I was hoping for something more along the lines of "inputValue" for Radio button groups.

    Thanks,
    Brett S.

  4. #4
    Sencha User carol.ext's Avatar
    Join Date
    Jun 2007
    Location
    Littleton, Colorado, USA
    Posts
    707
    Answers
    25

    Default

    Brett, I am not sure I am following what you were looking for, but Ext JS 5.x has data binding. That might do what you are looking for.

Posting Permissions

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