public UserListWidget(boolean enableActionDelete) { this.enableActionDelete = enableActionDelete; FlowPanel mainPanel = new AdvanceVerticalPanel(); mainPanel.add(initTopToolbar()); FlowPanel userListPanel = new FlowPanel(); mainPanel.add(userListPanel); dataGrid = new DataGrid(); userListPanel.add(dataGrid); dataGrid.addColumn("id", "", true, false).addColumn("name", "Nom", false, true, "90%"); if (enableActionDelete) { dataGrid.addColumn("delete", "Supprimer", false, false, "10%"); } dataSource = new DataSource(); dataGrid.setDataSource(dataSource); initWidget(mainPanel); }
public void addSelectedRowListener(DataGridSelectRowListener dataGridSelectRowListener) { if (dataGrid != null) { dataGrid.addSelectRowListener(dataGridSelectRowListener); } }