Position and SwipeToOpen Properties Doesn't effect widget

5 posts, 0 answers
  1. Deniz
    Deniz avatar
    6 posts
    Member since:
    Jul 2020

    Posted 16 Jul 2020 Link to this post

    I can successfully change position and swipeToOpen properties of my widget but it doesn't change anything. Position is always left even when I initialize Position property as right. Likely, swipeToOpen is always true even it's property value is false. 

     

    I change these values dynamically with the value of a checkbox like below;

    ->drawerInstance.options.mini =document.getElementById(widgetID+"toggle").checked;

    This line of code above changes mini properties and it works perfectly. 

    ->drawerInstance.options.swipeToOpen =document.getElementById(widgetID+"canSwipe").checked;

    On the other side, this line of code above  changes drawerInstance value properly but I can still use swipe gestures to open the drawer.

    Is there are any better ways to change the values of these properties? 

  2. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    1082 posts

    Posted 20 Jul 2020 Link to this post

    Hi, Deniz,

    Thank you for the provided explanations.

    For the position, I would recommend using the same approach as shown in this demo:

    https://demos.telerik.com/kendo-ui/drawer/functionality

     drawerInstance.position(position);
    drawerInstance.show()

    However, for the swipeToOpen setting,we would need the setOptions() method which is currently not implemented for the Drawer class. Meanwhile, you can destroy and create it again if you need to change the swipeToOpen functionality.

    https://docs.telerik.com/kendo-ui/intro/widget-basics/destroy

    Here is a runnable example for your reference:

    http://dojo.telerik.com/@bubblemaster/oZIPINoq

    Let me know if you would like me log a feature request on your behalf in our feedback portal so others can upvote it. The requests in high demand get pushed forward for implementation.

    Kind Regards,
    Alex Hajigeorgieva
    Progress Telerik

  3. Deniz
    Deniz avatar
    6 posts
    Member since:
    Jul 2020

    Posted 23 Jul 2020 in reply to Alex Hajigeorgieva Link to this post

    Hi Alex,

    Thank you for your answer. Your solution for position property works just perfect. However destroying and recreating widget to change swipeToOpen option is kind of complicated. How can I store all variables belongs to the drawer before destroying it and how can I pass it to the new drawer? If you could help with this one it would be great

     

    Thanks in advance

  4. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    1082 posts

    Posted 27 Jul 2020 Link to this post

    Hello, Deniz,

    You can get the options and pass them to the new instance like this:

    var options = drawerInstance.options;
    options.swipeToOpen = e.checked;
    drawerInstance.destroy();
    var elem = $("#drawer").empty();
    drawerInstance = elem.kendoDrawer(options).data("kendoDrawer");

    Here is an updated Dojo: http://dojo.telerik.com/UQiMilij

    Kind Regards,
    Alex Hajigeorgieva
    Progress Telerik

  5. Deniz
    Deniz avatar
    6 posts
    Member since:
    Jul 2020

    Posted 27 Jul 2020 in reply to Alex Hajigeorgieva Link to this post

    Hi Alex,

    Thank you for your time and sincere solutions,

    Best.

Back to Top