2

I'm using GWT 2.5 and am looking for a Tree widget which will allow me to have a multi-selection model controlled by checkboxes adjacent to each TreeNode. Something similar to the JQuery plugin described here with the following results:

enter image description here

As you might expect, I'd hope that checking a box would select all children of the checked node, and if any children are unchecked, you'd get the "half-checked" icon (shown by the "Solutions" node) -- so I'll need a three-state checkbox.

Does this widget exist in GWT already, or would I need to code it myself?

1 Answer 1

3

There is no default widget in GWT 2.5 that supports this. Your options:

  1. Use third-party library
  2. Implement you own widget

I used to implement my own based on CellTree and although it's feasible - it requires lots of work (custom tree model, cell widgets with renderers and value updater-s). If you flexible on choosing libraries - have a look at Smart GWT's checkbox tree.

3
  • Thanks for the tips -- I trust there's no chance of you open-sourcing any of your previous work?
    – Jeff Allen
    Oct 30, 2012 at 22:57
  • Building a cell will be interesting and copmplex, mostly since you need access to the children to see if they are selected and the parents to tell them which state to be in. GXT 3 also has support for this out of the box, see sencha.com/examples/#ExamplePlace:checkboxtree Oct 30, 2012 at 23:15
  • Jeff, i wish i could send you the code, but it's not an open-source. I guess SmartGWT or Sencha's sources can help you more since it was built as a library, not a custom solution for some particular case that i had. Oct 30, 2012 at 23:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.