Kendo UI- Data-show issue

Thanks a lot for your responses for my previous questions.

I was trying to call a function whenever a view becomes visible.Im using kendo framework. Using Data-show method i'm able to do it well when there are no parameters.

<div data-role="view" data-show="test">
.......
</div>

<script>
function test()
{
alert("Hello");
}
</script>

this works fine and alert being called whenever this view becomes visible.

but if i try with braces or with parameters its not working fine.

<div data-role="view" data-show="test('Hello')">
.......
</div>

<script>
function test(name)
{
alert(name);
}
</script>

this alert pops up only for the first time. Initially i was not able to get proper result for functions without parameters but the following link helped me in that but got struck here..

http://www.telerik.com/forums/page-(before)-show-events-are-only-triggered-once

Please help..Thanks in Advance.

Answers:

Answer

Actually it works, here you have the snippet working:

http://trykendoui.telerik.com/UwUy/2

Answer

It will not work this way because you are not passing a reference of a function to the data-show parameter of your view. The only way of passing parameters to a view is afaik the following:

http://docs.telerik.com/kendo-ui/mobile/view#view-parameters

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.