Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Fire Click Event?

    Hi

    I want fire a click event on column tree. How can I do this?

    Best Regards,
    -sipungora

    #2
    1. I create a new class MyColumnTree extends ColumnTree.
    2. I implemented handleSelectColumn method:
    Code:
     
    
            private int selectedColumn = 0;
            private Map<Integer, Integer> columnMap; //id->column
            private int lastColumn = 0;
    
    	public void handleSelectColumn() {
    		Canvas[] columns = getChildren();
    		for (Canvas column : columns) {
    			String columnId = column.getID();
    			if(!columnMap.containsKey(columnId)) {
    				columnMap.put(columnId, lastColumn++);
    			}
    			if(columnMap.get(columnId) != selectedColumn) {
    				column.hide();
    			}else {
    				column.focus();
    				column.fireEvent(new com.smartgwt.client.widgets.events.ClickEvent(column.getJsObj()));
    				
    
    			}
    		}
    	}
    3. I run this from scheduler:
    Code:
     
                    Scheduler scheduler = Scheduler.get();
    		scheduler.scheduleDeferred(new ScheduledCommand() {
    
    			@Override
    			public void execute() {
                                    ...
    				handleSelectColumn();
                                    ...
    			}});

    Comment

    Working...
    X