Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

TreeGrid wrong record selection after open folder

$
0
0
Hello,

We upgraded our application from 5.0p (NIGHTLY 2015-03-23) to 5.0p (NIGHTLY-2015-04-15) and we have an issue with record selection after an open folder event.
We are able to replicate this behaviour in a simple test case: if you run the code below after loading data, the first record is selected by DataArrivedHandler. Open the node 'Tammy Plant' without select it and then select record 'Susan Garfield': at this point the selected record is 'Tammy Plant' and not 'Susan Garfield'.
With SmartGWT 5.0p (NIGHTLY 2015-03-23) the selected record was 'Susan Garfield'.

Code:

public void onModuleLoad() {
               
        final TreeGrid tree = new TreeGrid(); 

        tree.setLoadDataOnDemand(false); 
        tree.setWidth(500); 
        tree.setHeight(150); 
        tree.setDataSource(EmployeeXmlDS.getInstance()); 
        tree.setAutoFetchData(true); 
        tree.setCanEdit(true);
        tree.setEditEvent(ListGridEditEvent.CLICK);
 
        TreeGridField nameField = new TreeGridField("Name", 150); 
        TreeGridField jobField = new TreeGridField("Job", 150); 
        TreeGridField salaryField = new TreeGridField("Salary"); 
 
        tree.setFields(nameField, jobField, salaryField);
       
                tree.addDataArrivedHandler(new DataArrivedHandler() {
                       
                        @Override
                        public void onDataArrived(DataArrivedEvent event) {
                                tree.startEditing(0);
                        }
                });
         
        tree.draw();
}

To test this example you must use in the datasource the attached xml data.

Browser version: Chrome 43.0.2357.81 (64-bit)

Thanks in advance

Attached Files
File Type: xml employees.data.xml (34.9 KB)

Viewing all articles
Browse latest Browse all 4756

Trending Articles