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

Views to not show the drawer

14 Answers 179 Views
Drawer (Mobile)
This is a migrated thread and some comments may be shown as answers.
Fernando
Top achievements
Rank 1
Fernando asked on 18 Jul 2013, 06:31 PM
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?

14 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 19 Jul 2013, 08:53 AM
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!
0
Fernando
Top achievements
Rank 1
answered on 22 Jul 2013, 05:34 PM
Sorry, I can't understand how I can prevent the drawer from showing using the beforeShow event =/
Can you show me some code?
0
Kiril Nikolov
Telerik team
answered on 23 Jul 2013, 07:52 AM
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!
0
Fernando
Top achievements
Rank 1
answered on 23 Jul 2013, 05:56 PM
Thanks!
0
Kiril Nikolov
Telerik team
answered on 24 Jul 2013, 06:54 AM
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!
0
Michael
Top achievements
Rank 1
answered on 16 Oct 2013, 02:50 PM
Once the drawer is not shown.. how do you get it to display?
0
Kiril Nikolov
Telerik team
answered on 16 Oct 2013, 03:18 PM
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!
0
Michael
Top achievements
Rank 1
answered on 16 Oct 2013, 03:25 PM
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?
0
Kiril Nikolov
Telerik team
answered on 17 Oct 2013, 10:12 AM
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!
0
Michael
Top achievements
Rank 1
answered on 17 Oct 2013, 02:45 PM
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. 
0
Kiril Nikolov
Telerik team
answered on 21 Oct 2013, 07:18 AM
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!
0
Michael
Top achievements
Rank 1
answered on 21 Oct 2013, 02:21 PM
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?
0
Michael
Top achievements
Rank 1
answered on 21 Oct 2013, 02:24 PM
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?
0
Michael
Top achievements
Rank 1
answered on 21 Oct 2013, 02:47 PM
ignore this post.
Tags
Drawer (Mobile)
Asked by
Fernando
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Fernando
Top achievements
Rank 1
Michael
Top achievements
Rank 1
Share this question
or