This is a migrated thread and some comments may be shown as answers.

Proper way to defer binding

1 Answer 433 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
jmillar
Top achievements
Rank 1
jmillar asked on 24 Nov 2014, 04:38 PM
Hi all;

I have a mobile list view bound to a server filtered datasource.  The filter, though, is going to be based on an attribute of the Users.currentUser() return.  For example, the list is bound to a set of customer quality names filtered by the customer ID for the currently logged in user.  I have it working by changing the filter on the data-show event of my view and doing a .read() on the data source, but that causes an extra round trip since the list is initially bound to an empty view.

What I'm taking a long time to ask is....can anybody share the "proper" way to dynamically change the filters for a data source based on the current state of something in the UI?  I realize I haven't posted an example, but hopefully my description of what I'm trying to accomplish is relatively straightfoward.

Thanks,
Jason

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 26 Nov 2014, 03:59 PM
Hi Jmillar,

You may set the autoBind configuration option of the ListView to false to suppress the initial dataSource read. In that way the DataSource will send request to the server only when the filters are set through the filter method. There is no need to call .read() after .filter().

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Data Source
Asked by
jmillar
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or