Model for Drawer access in related views

4 posts, 0 answers
  1. mike
    mike avatar
    23 posts
    Member since:
    Nov 2010

    Posted 26 Jan 2014 Link to this post

    I'm in a situation where I need to be able to access the model I have bound to the Drawer accessable to all the views it relates too. I've tried the below. Thanks in advance.


    //in the view like this
    app.filterService.viewModel.structureId

    //model for filter

    (function (global) {
      
        var FilterModel,
    app = global.app = global.app || {};

        FilterModel = kendo.data.ObservableObject.extend({

            structures: kendo.observable({ items: GetStructures()}),
            structureId: 49118,

            days: kendo.observable({
                items: [
                    { id: 7, name: "Past 7 Days" },
                    { id: 30, name: "Past 30 Days" },   
                    { id: 60, name: "Past 60 Days" },
                    { id: 90, name: "Past 90 Days" }]
            }),
            day: 7
        });
       
        app.filterService = { viewModel: new FilterModel() };
        console.log(app.filterService.viewModel.structureId);
    }
    )(window);



  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 28 Jan 2014 Link to this post

    Hi Mike,

    The code that you have provided looks OK and should be working as expected. Please provide us with a runnable jsFiddle/jsBin where this issue is reproduced, so we can investigate.

    Thank you in advance for your cooperation.

    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. mike
    mike avatar
    23 posts
    Member since:
    Nov 2010

    Posted 28 Jan 2014 Link to this post

    Another thing is I'm running this in Icenium, don't know if that makes a difference. 

    I'm going to try a couple things today and If I can't get this to work I'll get a jsfiddle up.

    Thanks,
  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 30 Jan 2014 Link to this post

    Hi Mike,

    Icenium should not make much difference (it still ships a relatively older version of Kendo UI, but if you have updated it, then it should be fine).

    So if the problem still persists, please extract a runnable sample, so we can take a look at.

    Thank you in advance for your cooperation.

    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready