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

Control data-bind inside a template rendered after bind

3 Answers 193 Views
Templates
This is a migrated thread and some comments may be shown as answers.
rlapao
Top achievements
Rank 1
rlapao asked on 15 May 2012, 05:28 PM
Hi,

Is it possible to render a template after the bind action?

I've created a sample jsFiddle here: http://jsfiddle.net/fnH58/1/ 

Thanks,
Ricardo

3 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 18 May 2012, 12:47 PM
Hi Racardo,

I am not sure if I understand your scenario correctly. Could you please provide more details about the logic you are trying to implement?

 

Greetings,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
rlapao
Top achievements
Rank 1
answered on 18 May 2012, 01:29 PM
Hi Iliana,

What I was trying to do was to render a template that have a data-bind properties on a page after the initial bind of my page-viewmodel.

For instance, you have a listview where you show some data, and on-click you want to show some details that are rendered from a different template.

In my example the details template correspond to:
<span data-bind="text: test">123</span>
which have a data-bind property.

However, the "test" value isn't bound.

Sorry, if i'm not being clearer :p and thanks for your reply.
0
Iliana Dyankova
Telerik team
answered on 23 May 2012, 12:54 PM
Hello Ricardo,

The recommended approach for your scenario is to replace the initial template with another one. For example, you could modify template2 to display the main and the detailed information together. Then in the change event just replace the initial template with template2.

For convenience I updated your jsFiddle example.I hope this helps.

 

Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Templates
Asked by
rlapao
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
rlapao
Top achievements
Rank 1
Share this question
or