Views to not show the drawer

15 posts, 0 answers
  1. Fernando
    Fernando avatar
    56 posts
    Member since:
    Sep 2012

    Posted 18 Jul 2013 Link to this post

    Hey guys

    Would not be easier if we could define in which view NOT to show the drawer?

    In my app, the only screen the drawer can't be opened is the login screen, so I have to specify ALL views of my app but one.

    What do you think?
  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 19 Jul 2013 Link to this post

    Hi Fernando,

    To achieve this functionality I would suggest you to use the beforeShow event of the login view and not show the Kendo UI Mobile Drawer widget. Please refer to the following link to read more about the beforeShow event:

    http://docs.kendoui.com/api/mobile/view#events-beforeShow


    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. Fernando
    Fernando avatar
    56 posts
    Member since:
    Sep 2012

    Posted 22 Jul 2013 Link to this post

    Sorry, I can't understand how I can prevent the drawer from showing using the beforeShow event =/
    Can you show me some code?
  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 23 Jul 2013 Link to this post

    Hello Fernando,

    I have linked the wrong beforeShow() event - the one of the view, and not on the Drawer widget. I apologize for my mistake, this is what I actually meant:

    http://docs.kendoui.com/api/mobile/drawer#events-beforeShow

    And here is the demo that you have requested:

    http://jsbin.com/iqanic/1/

    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Fernando
    Fernando avatar
    56 posts
    Member since:
    Sep 2012

    Posted 23 Jul 2013 Link to this post

    Thanks!
  7. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 24 Jul 2013 Link to this post

    Hello Fernando,

    I hope it worked. 

    If you need any further assistance do not hesitate to contact us back.
     
    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  8. Michael
    Michael avatar
    151 posts
    Member since:
    Jan 2012

    Posted 16 Oct 2013 Link to this post

    Once the drawer is not shown.. how do you get it to display?
  9. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 16 Oct 2013 Link to this post

    Hi Michael,

    I am not sure I understand correctly your question, but the Kendo UI Mobile Drawer has a built-in show() 
    method that you can use to show it. 

    If this is not what you are looking for, please open a separate topic or a support ticket, and elaborate a bit more about your problem.

    Thank you 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!
  10. Michael
    Michael avatar
    151 posts
    Member since:
    Jan 2012

    Posted 16 Oct 2013 Link to this post

    I did, but I accidentally posted in the general forum. The question is just, once you set:  data-before-show="prevent", how do you ever get the drawer to display? the show function doesn't do anything after that. its as if the drawer just doesnt exist. is there an enable function or some way to then un-prevent it?
  11. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 17 Oct 2013 Link to this post

    Hello Michael,

    The Kendo UI Drawer implementation changed, since the time this thread was opened. In the Drawer's configuration you can set the views that you want to show the Drawer for. Please take a look at this demo, and especially the data-views configuration of the Drawer:

    http://demos.kendoui.com/mobile/drawer/index.html#/

    Please elaborate a bit more about what exactly you are trying to achieve with your application, so we can suggest you an approach.
     
    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  12. Michael
    Michael avatar
    151 posts
    Member since:
    Jan 2012

    Posted 17 Oct 2013 Link to this post

    See: http://www.kendoui.com/forums/kendo-ui-mobile/general-discussions/edit-data-views-on-drawer.aspx

    I want the drawer available to every view, except for the first login view. After the user logs in, I would like the view to be shown on the login view as well. Is there a way to edit the view list?

    I used the preventdefault thing to hide it at the onset, but I have no idea how to get it to appear again after that. 
  13. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 21 Oct 2013 Link to this post

    Hi Michael,

    You can remove the view that you do not want to show the Drawer for from the data-views configuration attribute. And later on if you need to show the drawer for the particular view, you can just add the view's id to the array of views, with something like this:

    ('#my-drawer').data('kendoMobileDrawer').options.views.push('myview')
     

    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  14. Michael
    Michael avatar
    151 posts
    Member since:
    Jan 2012

    Posted 21 Oct 2013 Link to this post

    Thanks. Is there a similar command for removing a view from the list? or otherwise resetting the entire list? or even resetting the entire application?
  15. Michael
    Michael avatar
    151 posts
    Member since:
    Jan 2012

    Posted 21 Oct 2013 Link to this post

    to answer myself:

    yes,

     $('#my-drawer').data('kendoMobileDrawer').options.views.pop();

    will remove the last element from the view array.

    I imagine they can be edited using the standard JavaScript array functions in general?
  16. Michael
    Michael avatar
    151 posts
    Member since:
    Jan 2012

    Posted 21 Oct 2013 Link to this post

    ignore this post.
Back to Top
Kendo UI is VS 2017 Ready