/* * SmartGWT (GWT for SmartClient) * Copyright 2008 and beyond, Isomorphic Software, Inc. * * SmartGWT is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 3 * as published by the Free Software Foundation. SmartGWT is also * available under typical commercial license terms - see * http://smartclient.com/license * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; import com.smartgwt.client.widgets.grid.events.SelectionEvent; import com.smartgwt.sample.showcase.client.data.PartData; public class DragListSelectSample implements EntryPoint { public void onModuleLoad() { Canvas canvas = new Canvas(); final PartsListGrid mirrorSelectionList = new PartsListGrid(); mirrorSelectionList.setHeight(160); mirrorSelectionList.setEmptyMessage("
Nothing selected"); mirrorSelectionList.setLeft(200); final PartsListGrid myList1 = new PartsListGrid(); myList1.setHeight(160); myList1.setCanDragSelect(true); myList1.setData(PartData.getRecords()); myList1.addSelectionChangedHandler(new SelectionChangedHandler() { public void onSelectionChanged(SelectionEvent event) { mirrorSelectionList.setData(myList1.getSelection()); } }); canvas.addChild(myList1); canvas.addChild(mirrorSelectionList); canvas.draw(); } }