3

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.

lschin
  • 6,745
  • 2
  • 38
  • 52

1 Answers1

0
  • 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.

mkholod
  • 46
  • 3