add/delete listgrid by clicking +/- image button
I need a listgrid with +/-
button so that I can use these buttons for adding or deleting list grid.
ListGrid listGrid = new ListGrid();
listGrid.setWidth(230);
listGrid.setHeight(224);
listGrid.setDataSource(coursesDS);
listGrid.setCanDragRecordsOut(true);
listGrid.setDragDataAction(DragDataAction.COPY);
In this way only listgrid will be created, but is there any implicity functionality for increment listgrid by providing button specific to listgrid?
Or I need to create explicitly image button and 开发者_开发知识库have to write code so that I can add number of listgrids when click on image(add) button?
Please help. Thanks.
Regarding the "-" icon:
listGrid.setCanRemoveRecords(true);
Creates an additional rightmost column with "-" icon to remove the current row of the listGrid.
The closest I could find to "+" is in this example: http://www.smartclient.com/smartgwt/showcase/#grid_editing_new_row
listGrid.startEditingNew();
in the example the line is executed from onClick function inside ClickHandler for additional button.
精彩评论