开发者

add/delete listgrid by clicking +/- image button

开发者 https://www.devze.com 2023-03-18 08:41 出处:网络
I need a listgrid with +/- button so that I can use these buttons for adding or deleting list grid. ListGrid listGrid = new ListGrid();

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号