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.

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.