1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    3
    Vote Rating
    0
    bhavna2403 is on a distinguished road

      0  

    Default Checkbox with three states

    Checkbox with three states


    Hi All,
    I have a requirement of having a three state checkbox in our Sencha Touch App.
    Three states:
    Checked
    Unchecked
    Partial Check


    Any suggestions on how it can be achieved, or sample code.

    Thanks in advance

  2. #2
    Sencha User
    Join Date
    Aug 2011
    Posts
    5
    Vote Rating
    0
    asimgeker is on a distinguished road

      0  

    Default


    what is partial checked?

  3. #3
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    34
    Vote Rating
    0
    CRH is on a distinguished road

      0  

    Default Tri-State Checkbox

    Tri-State Checkbox


    Some applicatons use checkboxes that allow an indeterminate state in addition to the two provided by a normal checkbox. This third state is shown as a square or dash in the checkbox, and indicates that its state is neither checked nor unchecked. This is most often used when the checkbox is tied to a collection of items in mixed states. The indeterminate state cannot usually be selected by the user, and switches to a checked state when activated.


    source: http://en.wikipedia.org/wiki/Checkbox

  4. #4
    Sencha User
    Join Date
    Jul 2010
    Location
    Switzerland
    Posts
    78
    Vote Rating
    0
    fx-mike is on a distinguished road

      0  

    Default


    Unfortunately I don't have a solution, just work arounds.
    The checkbox is not laid out to be tri-state and I guess some major hacking would be needed to get this.
    I was having a similar requirement and used a select instead. A slider would also work nicely.
    Additionally, I used default values for checkboxes in my settings view to get rid of the initial indeterminate state.

  5. #5
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    34
    Vote Rating
    0
    CRH is on a distinguished road

      0  

    Default


    Good call on using the select/picker for the three values, wil use that work around until a tri-state chekbox is available. There is code for a tri-state checkbox in the Sencha Ext forum, which does load, but does not give the three states, assuming due to fundamental differences in the underlying Checkbox code for Ext vs. Touch.

Thread Participants: 3

Tags for this Thread