/* * Isomorphic SmartGWT web presentation layer * Copyright 2000 and beyond Isomorphic Software, Inc. * * OWNERSHIP NOTICE * Isomorphic Software owns and reserves all rights not expressly granted in this source code, * including all intellectual property rights to the structure, sequence, and format of this code * and to all designs, interfaces, algorithms, schema, protocols, and inventions expressed herein. * * If you have any questions, please email
. * * This entire comment must accompany any portion of Isomorphic Software source code that is * copied or moved from this file. */ import com.smartgwt.client.data.DataSource; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.IButton; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.layout.HStack; import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwtee.sample.showcase.client.PanelFactory; import com.smartgwtee.sample.showcase.client.ShowcasePanel; import com.smartgwtee.sample.showcase.client.dataintegration.java.form.FormValidationSample; public class CustomDataSourceSample implements EntryPoint { public void onModuleLoad() { DataSource customDS = DataSource.get("customDataSource_user"); final ListGrid userList = new ListGrid(); userList.setWidth(600); userList.setHeight(224); userList.setDataSource(customDS); userList.setCanEdit(true); userList.setCanRemoveRecords(true); userList.setAutoFetchData(true); userList.setUseAllDataSourceFields(true); IButton addButton = new IButton("Create User"); addButton.setWidth(110); addButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { userList.startEditingNew(); } }); VLayout layout = new VLayout(15); layout.addMember(userList); layout.addMember(addButton); layout.draw(); } }