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

itemClick event without closing the drawer

1 Answer 486 Views
Drawer
This is a migrated thread and some comments may be shown as answers.
Deniz
Top achievements
Rank 1
Veteran
Deniz asked on 06 Aug 2020, 11:52 AM

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.

1 Answer, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 10 Aug 2020, 06:35 AM

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

Tags
Drawer
Asked by
Deniz
Top achievements
Rank 1
Veteran
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or