I am using the HTML wrapper for the ListView in MVC. I give the ListView a datasource to an Odata service. I am using a template to display the items in the ListView. When the page first loads and service returns the data the templates are rendered on the bind. However, when I attempt to query the data source the template is not rendered. The call to my OData service succeeds and data is returned as confirmed in the Developer Tools, and loading spinner is displayed over the control while the query is executing.
The idea here is that I will call the query on a button click so that I can apply filters.
Thanks
Template:
<
script
type
=
"text/x-kendo-tmpl"
id
=
"resultsViewTemplate"
>
<
div
class
=
"col-md-6"
>
<
div
class
=
"thumbnail"
>
<
h2
>
#:Name#
</
h2
>
<
div
class
=
"result-item location"
>
<
h3
>Location:</
h3
>
<
p
>#:Floor#</
p
>
<
p
>#:StreetAddress#</
p
>
<
p
>#:City#, #:State# #:ZipCode#</
p
>
</
div
>
<
div
class
=
"result-item restrictions"
>
<
h3
>Restrictions:</
h3
>
<
p
></
p
>
<
p
></
p
>
</
div
>
<
div
class
=
"result-item amenities"
>
<
h3
>Amenities</
h3
>
</
div
>
</
div
>
</
div
>
</
script
>
Query:
$("#update").on("click", function(e) {
$("#resultsListView").data().kendoListView.dataSource.query();
});
Configuration of the ListView:
@(Html.Kendo().ListView<ResourceViewModel>()
.TagName(
"div"
)
.ClientTemplateId(
"resultsViewTemplate"
)
.AutoBind(
true
)
.DataSource( ds => ds
.Custom()
.Type(
"odata-v4"
)
.Transport( tp => tp
.Read( read => read
.Url($
"/api/vm/Resources/Models.GetAvailable"
)
)
)
.PageSize(6)
.ServerPaging(
true
)
.ServerSorting(
true
)
)
.Name(
"resultsListView"
)
)