Results 1 to 10 of 88

Thread: [2.2] Tri-state tree/Tree with themed checkbox [NEW v1.2]

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    The Netherlands
    Vote Rating

    Smile [2.2] Tri-state tree/Tree with themed checkbox [NEW v1.2]

    Ext 2.2 introduced a themed checkbox component, but unfortunately the new checkbox theme wasn't used for trees and fieldsets.

    So I started out making a TreeNodeUI that would use checkbox images instead of checkbox inputs.
    After I finished I couldn't resist making a TreeNodeUI descendant that would do what many of you have asked for: support checkboxes with a grayed/partial state and automatic cascading.

    Include TreeCheckbox.css and TreeCheckbox.js to get themed checkboxes in your grid.

    Include TriStateNodeUI.css and TriStateNodeUI.js and set the uiProvider to TriStateNodeUI to get automatic update of parent/child checked states.
    If your tree is very large or if you are using asynchronous node loading (AsynchTreeNode) you should use AsynchTriStateNodeUI instead of TriStateNodeUI (because children that aren't loaded yet can't be checked/unchecked).

    Check out example.html to see how to use the new components.

    Version 1.1:
    - Removed CSS margin.
    - Added getChecked method to return correct checked state, even with AsynchTriStateNodeUI.
    - Changed TriStateNodeUI to do a real check cascade and moved the original virtual cascading code to AsynchTriStateNodeUI, to be used when a real cascade is to slow (large tree) or impossible (asynchronous node loading).

    New version 1.2:
    - Fixed bug when in mixing nodes with and without checkboxes.
    - Only fire checkchange if checked stated actually changed.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Condor; 17 Dec 2008 at 7:47 AM. Reason: Updated to version 1.2

Posting Permissions

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