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

MVVM: using 3 observable in 1 template

4 Answers 85 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Neeraj
Top achievements
Rank 1
Veteran
Neeraj asked on 20 Nov 2018, 05:30 AM
Hello,
          Can we bind 3 observable to different parts of template? The reason to have 3 observable is to have modularity and performance improvement. Earlier we had 2 observable and our object are pretty big. We dont want to have more processing and UI rendering delays so we have thought to have 3 observable .
         Now the thing is we have a window all coded mvvm way. This window needs object to be binded to open , if i bind empty object later , i cannot bind any div with observable object . kendo.bind() doesnt have any output then.
         What would be solution for this?

4 Answers, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 21 Nov 2018, 03:11 PM
Hello Neeraj,

I am afraid that the kendo observable is not designed for such modularity and having a different object is a not supported scenario.

Regards,
Nencho
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Neeraj
Top achievements
Rank 1
Veteran
answered on 22 Nov 2018, 09:20 AM

1 more question:
      this is all coded in mvvm.I have list of priceitem and on selection of priceItem i am binding to PriceDetailTemplate. This PriceDetailTemplate template has some sumeric textbox and also contains 4 buttons and on click of 4 button ,it opens window and all 4 window has different Grids with different data in them specific to Grid. 
      When i bound data to all windows and Grids first time , it works well and when i bind second item , the window grid shows data of first item (data which was of 1st item ), i think it may be due to grid creates copy of local data when it forms.
     what is the best way to update data of 2nd item selected . 
   Further more to Save details, i am sending ajax call to C# controller which return object with Id and i update with following statement.

// ImportPNRPricingViewModel is observable object , Tsts is the Item that can be selected which will be bind to PriceDetailsTemplate
 
//response is success response from ajax
var observableResponse = kendo.observable(response);
var temp2 = $.extend(true, ImportPNRPricingViewModel.Tsts._data[index], observableResponse); //this line update details

I tried to use destroy() method of kendo and jquery remove() to remove element from DOM , but doesnt work well. It may take time to create sample since process is long. If you can understand my explaination well and good. In short just tell me how to show 2nd selected Item data in that Grid inside kendoWindow which is showing 1st item data

0
Nencho
Telerik team
answered on 26 Nov 2018, 09:45 AM
Hello Neeraj,

I am afraid that it is quite hard to give you a suggestion for such a rather complex implementation, without being able to evaluate the actual code. That being said, could you please show us the implementation that you currently have at your end, in order to get a clearer picture and determine whether the functionality is feasible?

Regards,
Nencho
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Neeraj
Top achievements
Rank 1
Veteran
answered on 27 Nov 2018, 08:32 AM
Ok, for sample it will take some time
Tags
MVVM
Asked by
Neeraj
Top achievements
Rank 1
Veteran
Answers by
Nencho
Telerik team
Neeraj
Top achievements
Rank 1
Veteran
Share this question
or