ListDataProvider.addDataDisplay() and setRowData

99 views
Skip to first unread message

tong123123

unread,
Oct 26, 2012, 3:44:26 AM10/26/12
to google-we...@googlegroups.com
if I called ListDataProvider.addDataDisplay(DataGrid); I found no need to use setRowData(List);
so when to use setRowData and when to use ListDataProvider as the data source for DataGrid?

Benjamin Possolo

unread,
Oct 29, 2012, 5:28:07 PM10/29/12
to google-we...@googlegroups.com
ListDataProvider wraps a list collection. It allows you to modify the wrapped collection and to automatically propagate those changes to the UI.

If you do not use the ListDataProvider (and just call setRowData()) directly, then you will need to call setRowData() whenever you make changes to your list.

So basically, if you intend on modifying the list (adding/deleting) after it is rendered, use the ListDataProvider.
If you are just setting the list data to show it, then just use setRowData()
Reply all
Reply to author
Forward
0 new messages