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

[Solved] Wildcard datasource refresh?

1 Answer 132 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
BRAD
Top achievements
Rank 1
BRAD asked on 19 Sep 2014, 06:00 PM
I have a page where a user can select multiple listviews to view.  At certain points, i want to refresh all of these listviews. I'm trying to refresh them using a wildcard statement, but:
<code>
$("[id^=lstMss]").data("kendoListView").dataSource.read();
</code>
only refreshes the first listview, none of the other ones (all of my listviews start with the id of 'lstMss').  Is there a better, easier way to do this?

1 Answer, 1 is accepted

Sort by
0
Accepted
Alexander Popov
Telerik team
answered on 23 Sep 2014, 11:27 AM
Hello Brad,

This is expected, because the data method is applied only for the first item matching the selector. I would recommend iterating over all matching items and calling the read method for each one separately. For example: 
$("[id^=lstMss]").each(function() {
    $(this).getKendoListView().dataSource.read();
})

Regards,
Alexander Popov
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
BRAD
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or