Results 1 to 2 of 2

Thread: Validating Fieldset within CheckboxGroup

  1. #1
    Sencha User
    Join Date
    Sep 2013
    Posts
    19
    Answers
    1

    Default Answered: Validating Fieldset within CheckboxGroup

    Here's the setup in Fiddle: https://fiddle.sencha.com/#fiddle/882

    Essentially, I have a fieldset using checkboxToggle as an option within a checkbox group. I have allowBlank set to false on the checkbox group, which means the user should have to select at least one of the options.

    Problem is, the fieldset checkbox ("Option 3") is taken into account when validating the checkbox group, but doesn't trigger the validation itself. So while the group is valid or invalid when "Option 3" is checked or unchecked (repectively), you have to click Option 1 or 2 before the group will validate.

    Just thought I'd pose the question here and see if anyone has any solutions or alternate approaches.

    Cheers!

  2. Found a simple workaround, posted below. Perhaps this thread is better placed in the bugs sub-forum?

    On the fieldset, add the following listeners:
    Code:
    collapse: function () {
        var ccGroup = this.up('checkboxgroup');
        ccGroup.validate();
    },
    expand: function () {
        var ccGroup = this.up('checkboxgroup');
        ccGroup.validate();
    }

  3. #2
    Sencha User
    Join Date
    Sep 2013
    Posts
    19
    Answers
    1

    Default

    Found a simple workaround, posted below. Perhaps this thread is better placed in the bugs sub-forum?

    On the fieldset, add the following listeners:
    Code:
    collapse: function () {
        var ccGroup = this.up('checkboxgroup');
        ccGroup.validate();
    },
    expand: function () {
        var ccGroup = this.up('checkboxgroup');
        ccGroup.validate();
    }

Tags for this Thread

Posting Permissions

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