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

Using MultiSelect (Single Mode) attempting to create a .TagTemplate using maxTotal or currentTotal

1 Answer 87 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Doug
Top achievements
Rank 1
Doug asked on 12 May 2016, 02:14 PM

I'm looking to get the MultiSelect list to display something like "1 out of 15"  But when using the "maxTotal" found here tagTemplate, I get "maxTotal is not defined"

 

1.<script type="text/x-kendo-template" id="selectedRoleTemplate">
2.    #:data.length# out of #:maxTotal#
3.</script>
4.<script type="text/javascript">
5.    var selectedRoleTemplate = kendo.template($("#selectedRoleTemplate").html(), { useWithBlock: false });
6.</script>

 

01.@(Html.Kendo().MultiSelectFor(m => m)
02.      .AutoBind(true)
03.      .AutoClose(false)
04.      .DataValueField("RoleId")
05.      .DataTextField("RoleName")
06.      .TagMode(TagMode.Single)
07.      .TagTemplate("#=selectedRoleTemplate()#")
08.      .DataSource(dataSource =>
09.      {
10.          dataSource.Read(read => read.Action("UserRoleList", "Lov", new { userId = -9, isActiveOnly = false}))
11.              .ServerFiltering(false);
12.      }))

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Hristo Valyavicharski
Telerik team
answered on 14 May 2016, 03:00 PM
Hi Doug,

Please look at this forum post: 

http://www.telerik.com/forums/how-to-run-a-function-inside-a-template

Does it help?

Regards,
Hristo Valyavicharski
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
MultiSelect
Asked by
Doug
Top achievements
Rank 1
Answers by
Hristo Valyavicharski
Telerik team
Share this question
or