
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve
asked on 01 Dec 2014, 04:42 PM
Whats the best way to update an array element?
My array list is massive (large objects) so if I clone it, change THAT array, then set the clone back, there's some noticable lag in the app.
How would I just update a array element, or like a single property OF that array element.
My array list is massive (large objects) so if I clone it, change THAT array, then set the clone back, there's some noticable lag in the app.
How would I just update a array element, or like a single property OF that array element.
7 Answers, 1 is accepted
0
Hi Steve,
Please check this example as it demonstrates how to update single property of an array element: http://dojo.telerik.com/@valchev/OtIjI
Regards,
Alexander Valchev
Telerik
Please check this example as it demonstrates how to update single property of an array element: http://dojo.telerik.com/@valchev/OtIjI
Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 03 Dec 2014, 05:50 PM
Okay let me ask you this...
Given this in my template
<span data-bind="attr: { class: getStatusClass }"><span data-bind="text: Status"></span></span>
<span class="logcount" title="Encounters Logged"><span data-bind="text: LogCount"></span>
When I update "Status" on the item as you defined, the text updates okay, but the getStatusClass function isn't called. I used to have it as <span class="status #: Status #" but that wasn't updating through the model change...so I moved it to a function.
What should I be doing here?
Given this in my template
<span data-bind="attr: { class: getStatusClass }"><span data-bind="text: Status"></span></span>
<span class="logcount" title="Encounters Logged"><span data-bind="text: LogCount"></span>
When I update "Status" on the item as you defined, the text updates okay, but the getStatusClass function isn't called. I used to have it as <span class="status #: Status #" but that wasn't updating through the model change...so I moved it to a function.
What should I be doing here?
0
Hello Steve,
Could you please update the Dojo example that I provided below so it illustrates your exact case?
In this way I will be able to examine your exact implementation and assist you further.
Regards,
Alexander Valchev
Telerik
Could you please update the Dojo example that I provided below so it illustrates your exact case?
In this way I will be able to examine your exact implementation and assist you further.
Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 05 Dec 2014, 02:46 PM
Sure here: http://jsbin.com/famixo/2/
Why aren't the completed items turning green?
Why aren't the completed items turning green?
0
Hi Steve,
Issue occurs because dependent methods must use the get method to get field values. For more information please check this help article:
Here is a link to the updated example: http://jsbin.com/qiqexuroxa/1/edit
Please also note that the template should have a single root item.
Regards,
Alexander Valchev
Telerik
Issue occurs because dependent methods must use the get method to get field values. For more information please check this help article:
Here is a link to the updated example: http://jsbin.com/qiqexuroxa/1/edit
Please also note that the template should have a single root item.
Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 05 Dec 2014, 03:34 PM
Ah geez yeah, thanks
Hey, is there a way to do it right from the template so I don't have to have a function to return a single bound value?
Hey, is there a way to do it right from the template so I don't have to have a function to return a single bound value?
0
Hi Steve,
The getStatusClass method basically gets the "Status" value. You may bind the class directly to the "Status" field.
Regards,
Alexander Valchev
Telerik
The getStatusClass method basically gets the "Status" value. You may bind the class directly to the "Status" field.
Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!