1. #1
    Ext JS Premium Member
    Join Date
    Jun 2011
    Posts
    255
    Vote Rating
    7
    ontho is on a distinguished road

      0  

    Default Tri-state checkbox for ExtJs 4.0

    Tri-state checkbox for ExtJs 4.0


    Hello, has anybody done a tri-state checkbox for ExtJs 4? For a search form I need to let the user input true, false and "do not search"...

  2. #2
    Ext JS Premium Member stevil's Avatar
    Join Date
    Nov 2007
    Location
    Denver, CO
    Posts
    1,045
    Vote Rating
    9
    stevil will become famous soon enough

      0  

    Default


    Haven't done a proper one with a separate style for the third state, but the source code suggests that true, false, and undefined are legitimate values (false and undefined would evaluate the same if calling (return !chk.getValue()), but not if calling (var chkVal = chk.getValue(); return !chkVal && (chkVal === undefined)).

    Do you need a different visual cue, or is "not set" enough for you? do you need to cycle between true, false, not set (which would imply "yes" to my previous question)?

    I think that an extension to Ext.form.field.Checkbox could do this...

    stevil

  3. #3
    Sencha User
    Join Date
    Jun 2011
    Posts
    4
    Vote Rating
    0
    sureshsk is on a distinguished road

      0  

    Default Tree store

    Tree store


    I would like to create a tree that has nodes that when they are expanded - their info is retrieved. I do NOT want to have to get all the levels of the tree in my TreeStore. I only want the level I'm on. For example, lets take a file explorer. I have a folder node that has children, but I don't want to go get those (or read) the children until the folder is expanded.
    I've set up a TreePanel with a TreeStore, but the proxy method appears to be called just once to give me the opportunity to fill out the WHOLE tree store. This is NOT what I want I just want to fill out what is visible.
    On thing I thought of is to extend NodeInterface and not use a TreeStore. In there I can handle the "lazy" initialization of the children. Is this the right approach?
    Any ideas or examples? I'm sure someone has done this.
    businesscards

  4. #4
    Ext JS Premium Member
    Join Date
    Jun 2011
    Posts
    255
    Vote Rating
    7
    ontho is on a distinguished road

      0  

    Default


    Quote Originally Posted by stevil View Post
    Do you need a different visual cue, or is "not set" enough for you? do you need to cycle between true, false, not set (which would imply "yes" to my previous question)?

    I think that an extension to Ext.form.field.Checkbox could do this...
    Yes and yes. It would be greate to be able to toggle between 2- and 3-state. I'll have a look at the source of Ext.form.field.Checkbox, I just thought I could spare the work... ;-)

    @sureshsk: I think you should open a seperate thread for this. In ExtJs 3, there were async-treenodes which did what you need, but I thought I read somewhere that the new treenodes are able to do both.

  5. #5
    Ext JS Premium Member stevil's Avatar
    Join Date
    Nov 2007
    Location
    Denver, CO
    Posts
    1,045
    Vote Rating
    9
    stevil will become famous soon enough

      0  

    Default


    @sureshsk - look at the XML tree example on the examples site - I verified that it loads one node at a time in Fiddler.

    @ontho - I don't think you can get around this, because I'm betting that the click event cycles in boolean fashion (setValue(!getValue()) sort of thing, and I think you need to add a switch statement. Also, it seems like you'd have to apply a different cls to the component based on its value (so as to get the "grayed out" look of a tri-state value)?

    Finally, the consumer of the check box must remember to distinguish between false and undefined...

    stevil

  6. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,327
    Vote Rating
    850
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    I have a feature request in for tri-state checkboxes and right now it is scheduled for 4.1.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  7. #7
    Ext JS Premium Member
    Join Date
    Jun 2011
    Posts
    255
    Vote Rating
    7
    ontho is on a distinguished road

      0  

    Default


    Ah, that sounds good! Stops me from doing the work twice. Any time-slot when the 4.1 is about to be released (approximately)?

  8. #8
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,327
    Vote Rating
    850
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    approximately.... 2011 No, there isn't any time frame right now as we are working on dot releases to fix the major bugs before going on to new stuff for 4.1
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  9. #9
    Ext JS Premium Member
    Join Date
    Jun 2011
    Posts
    255
    Vote Rating
    7
    ontho is on a distinguished road

      0  

    Default


    Thanks for your reply. I have a bigger project that has to be planned and which has to be finished in september/october, so I guess to be sure, I better write something on my own.

  10. #10
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,327
    Vote Rating
    850
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Quote Originally Posted by ontho View Post
    Thanks for your reply. I have a bigger project that has to be planned and which has to be finished in september/october, so I guess to be sure, I better write something on my own.
    Unfortunately in your circumstance I would recommend that. If anything, it will teach you more about the framework which is very valuable. This will be the first release ever with tri-state checkbox when it does come out
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.