wcx6298 / smartgwt

Automatically exported from code.google.com/p/smartgwt
0 stars 0 forks source link

Reordering of rows in ListGrid with CHECKBOX selection requires ticking the checkbox #670

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

What steps will reproduce the problem?
1. try dragging the rows to reorder them

What is the expected output? What do you see instead?
I expect the reorder to work without having to tick the checkbox.
Instead nothing happens unless I tick the checkbox

What version of the product are you using? On what operating system?
SmartGwt 3.0
Windows 7

What browser(s) does this happen in?  Are there any browsers where the
issue does not occur?
All browsers

Please provide any additional information below.
Test Case:

public void onModuleLoad() {
    DataSourceTextField continentField = new DataSourceTextField("continent");
    continentField.setPrimaryKey(true);

    DataSource dataSource = new DataSource();
    dataSource.setClientOnly(true);
    dataSource.setFields(continentField);
    dataSource.setCacheData(new CountryData().getNewRecords());

    ListGrid myGrid = new ListGrid();
    myGrid.setWidth(200);
    myGrid.setHeight(100);
    myGrid.setDataSource(dataSource);
    myGrid.fetchData();
    myGrid.setCanReorderRecords(true);
    myGrid.setSelectionAppearance(SelectionAppearance.CHECKBOX);
    myGrid.setSelectionType(SelectionStyle.SIMPLE);
    myGrid.draw();
}

class CountryData {

    public CountryRecord[] getNewRecords() {
        return new CountryRecord[] { 
                new CountryRecord("North America"), 
                new CountryRecord("Asia") };
    }
}

class CountryRecord extends ListGridRecord {
    public CountryRecord(String continent) {
        setContinent(continent);
    }

    public void setContinent(String continent) {
        setAttribute("continent", continent);
    }

    public String getContinent() {
        return getAttributeAsString("continent");
    }
}

Original issue reported on code.google.com by sta191...@gmail.com on 7 May 2012 at 8:41

GoogleCodeExporter commented 9 years ago
Not a bug - drag and drop acts on the selection.  If you want a column of 
checkboxes that is independent of the selection use a field of type:boolean.

Original comment by smartgwt...@gmail.com on 7 May 2012 at 5:58