PDA

View Full Version : get checked item in a TreePanel



poseidonjm
4 Jan 2011, 2:00 PM
In a TreePanel , i saw addCheckListener and getCheckedSelection which returns a list
but i would like get the element that has been checked or unckecked not all checked elements.
Can anyone help me? :-?
I'm Sorry, this is my english:

poseidonjm
4 Jan 2011, 2:32 PM
I found in this thread http://www.sencha.com/forum/showthread.php?83596-How-to-know-when-the-checkbox-of-the-treepanel-is-checked
My code looks like:))


tree.addListener(Events.CheckChange, new Listener<TreePanelEvent<MenuOpciones>>(){

@Override
public void handleEvent(TreePanelEvent<MenuOpciones> be) {
// TODO Auto-generated method stub
MenuOpciones m = be.getItem();
if(be.isChecked()){

System.out.println("check "+m.getMenu());
}else
System.out.println("uncheck"+m.getMenu());
}

});