itemClick event without closing the drawer

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

    Posted 06 Aug 2020 Link to this post

    Hi,

    I've worked on various ways to prevent drawer closing when itemClick event triggered but I couldn't figure a solution. Is there a way to disable auto closing when itemClick event performed?

    Thanks.

  2. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1236 posts

    Posted 10 Aug 2020 Link to this post

    Hello Deniz,

    You could use a combination of the iitemClick and hide events of the Drawer to achieve the desired. In the itemClick event, you are setting a flag that an item has been clicked:

    var shouldPrevent = false;
    ...
    itemClick: function(e) {            
      shouldPrevent = true;
    },

    While in the hide event, if that flag is true, you are preventing the default execution of the logic:

    hide: function(e) {
      if(shouldPrevent) {
        shouldPrevent = false;
        e.preventDefault();
      }
    },

    Here is a small Dojo sample implementing the above:

    https://dojo.telerik.com/eXUnaveT/3

    Regards,
    Veselin Tsvetanov
    Progress Telerik

Back to Top