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

Set view to the initial state

5 Answers 58 Views
SPA
This is a migrated thread and some comments may be shown as answers.
Raja
Top achievements
Rank 1
Raja asked on 01 Aug 2014, 06:36 AM
Hi,

I am building a data entry screen using Kendo UI SPA. My users will do lot of data entry each day. So after filling in a form and pressing Save should save the records and again present them the same screen for data entry. How can I reset all the controls (or View Model) to initial state?

Thanks

5 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 05 Aug 2014, 07:26 AM
Hello Raja,

The observable object does not provide any way to reset its properties to its initial state, I am afraid you will need to manually set each of them:

http://docs.telerik.com/kendo-ui/api/framework/model#methods-set

I am sorry for any inconvenience caused.

Kind Regards,
Petur Subev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Raja
Top achievements
Rank 1
answered on 09 Aug 2014, 12:53 AM
Thank you for the response. But I am facing a problem this way also. If I set the field to a specific value, control that is bound to that value is not effected. I thought the value binding is bi-directional. Can you help?
0
Petyo
Telerik team
answered on 12 Aug 2014, 08:13 AM
Hi Raja,

That's correct - the value binding is bi-directional. Can you reproduce the problem you are facing in the Dojo? We will take a look.

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Raja
Top achievements
Rank 1
answered on 13 Aug 2014, 04:28 PM
I think I found out what I am doing wrong. I have a model property "selectedValue" which I am trying to set from a function in the model like this which is not working.

model.selectedValue = 1;

Below piece of code seems to be working and changes the associated dropdown selection.

model.set("selectedValue",1);

Thank you for your help.
0
Petyo
Telerik team
answered on 14 Aug 2014, 10:30 AM
Hello,

this is correct, you should use the set method, as our documentation suggests in order for the bindings to update correctly. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
SPA
Asked by
Raja
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Raja
Top achievements
Rank 1
Petyo
Telerik team
Share this question
or