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

Access to Datastore within x-kendo-template?

1 Answer 19 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
AceRoute Dev
Top achievements
Rank 1
AceRoute Dev asked on 04 Feb 2014, 07:01 AM
How do I access datastore and/or global objects from within template?

1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 06 Feb 2014, 09:21 AM
Hi,

You can access global variables the same way you will access them in other JavaScript functions - please check the example below:

<script>   
    globatlVariable = "someText";
</script>
 
@(Html.Kendo().Scheduler<TestKendoProject.Models.SchedulerEvent>()
    .Name("scheduler")
    //the variable should be available in current scope
    //this template will render "someText" in the all-day events
    .AllDayEventTemplate("#=globatlVariable#")

Kind Regards,
Vladimir Iliev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Scheduler
Asked by
AceRoute Dev
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or