MVVM: using 3 observable in 1 template

5 posts, 0 answers
  1. Neeraj
    Neeraj avatar
    135 posts
    Member since:
    May 2015

    Posted 19 Nov 2018 Link to this post

    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?
  2. Nencho
    Admin
    Nencho avatar
    1871 posts

    Posted 21 Nov 2018 Link to this post

    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.
  3. Neeraj
    Neeraj avatar
    135 posts
    Member since:
    May 2015

    Posted 22 Nov 2018 Link to this post

    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

  4. Nencho
    Admin
    Nencho avatar
    1871 posts

    Posted 26 Nov 2018 Link to this post

    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.
  5. Neeraj
    Neeraj avatar
    135 posts
    Member since:
    May 2015

    Posted 27 Nov 2018 in reply to Nencho Link to this post

    Ok, for sample it will take some time
Back to Top