Results 1 to 5 of 5

Thread: Checkbox field on form with binding cannot be selected

  1. #1
    Sencha Premium User
    Join Date
    Apr 2011
    Posts
    109
    Answers
    1

    Default Checkbox field on form with binding cannot be selected

    Hello,

    I have an issue using a checkbox field against an int field with data binding where I cannot select the checkbox if it is unchecked. Here is a fiddle: https://fiddle.sencha.com/#view/editor&fiddle/29na
    If you uncheck the box it cannot be checked, it flashes but does not stay checked. The field value is 1 or 0.

    Thank you
    Rudy

  2. #2
    Sencha Premium User
    Join Date
    Apr 2011
    Posts
    109
    Answers
    1

    Default

    Hi Animal,

    I know you replied to me because I received an email but it's not showing in here yet. Anyway, your updated fiddle is throwing an appyBind error: Cannot bind checked on Ext.form.field.Checkbox - missing a setChecked method.

    thanks.

  3. #3
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892
    Answers
    41

    Default

    Can't figure it out on my iPad. Need to get the debugger going. It should definitely be possible. I'll try again tomorrow.

  4. #4
    Sencha Premium User
    Join Date
    Apr 2011
    Posts
    109
    Answers
    1

    Default

    I wanted to bump this. I have a lot of values that are defined as int (1 or 0) and displayed as a checkbox on a form. The issue has come up since using a ViewModel with binding. The fiddle shows the behavior of not being able to check the box once unchecked (if previously checked). I am wondering if I have the field configured wrong or is it a possible bug. When the form is submitted the values is coming in as null if it was previously a 1. Any help resolving this would be greatly appreciated.

    Thank you
    Rudy

  5. #5
    Sencha Premium User
    Join Date
    Apr 2011
    Posts
    109
    Answers
    1

    Default

    Hi All,

    I worked on this a bit more and it is working but I would like confirmation on what I did. Here is the fiddle: https://fiddle.sencha.com/#view/editor&fiddle/29na
    The change is in the model for the integer field by adding a "convert" method. Prior to adding the convert the change event for the integerType field was firing twice when trying to check the field which is why it flashes on then off.

    I would also like to make the convert method call a globally defined method, something like shown in the doc: http://docs.sencha.com/extjs/6.5.2/c...method-convert

    I was going to define the method in Application.js and then define the model as convert: Designer.app.convertBooleanToInt

    Thank you

Similar Threads

  1. Form Field Binding with loadRecord
    By jtrueblood in forum Ext JS 6.x Q&A
    Replies: 0
    Last Post: 19 May 2017, 6:49 AM
  2. Form Field switching with Binding
    By REM955 in forum Ext JS 6.x Q&A
    Replies: 1
    Last Post: 2 Feb 2017, 11:51 PM
  3. Replies: 2
    Last Post: 20 Mar 2013, 2:39 AM
  4. binding boolean to a CheckBox field
    By Bill_Gates in forum Ext GWT: Discussion
    Replies: 2
    Last Post: 3 Mar 2013, 11:26 PM
  5. binding a Checkbox to a numeric field
    By bogc in forum Ext: Discussion
    Replies: 4
    Last Post: 21 Dec 2012, 11:13 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
  •