Disable Swipe On Dialogs

This is the code for the Gantt and the dialogs:


<GanttComponent
...
>

        <AddDialogFieldsDirective >
          <AddDialogFieldDirective type='General' headerText='General' fields={[this.taskFields.name, this.taskFields.startDate, this.taskFields.endDate, this.taskFields.progress]}></AddDialogFieldDirective>
          <AddDialogFieldDirective type='Dependency'></AddDialogFieldDirective>
          <AddDialogFieldDirective type='Resources' fields={[this.resourceFields.id, this.resourceFields.name]}></AddDialogFieldDirective>
        </AddDialogFieldsDirective>
        <EditDialogFieldsDirective>
          <EditDialogFieldDirective type='General' headerText='General' fields={[this.taskFields.name, this.taskFields.startDate, this.taskFields.endDate, this.taskFields.progress]}></EditDialogFieldDirective>
          <EditDialogFieldDirective type='Dependency'></EditDialogFieldDirective>
          <EditDialogFieldDirective type='Resources' fields={[this.resourceFields.name]}></EditDialogFieldDirective>
        </EditDialogFieldsDirective>
</GanttComponent>

4 Replies 1 reply marked as answer

MA matteomessmer March 16, 2022 03:03 PM UTC

Hi,

I was wondering if it were possible to disable the swipe functionality.




For me it would be better that the dialog doesn't change tab when I swipe.

This is the code for the Gantt and dialogs.

<GanttComponent
...
>

        <AddDialogFieldsDirective >
          <AddDialogFieldDirective type='General' headerText='General' fields={[this.taskFields.name, this.taskFields.startDate, this.taskFields.endDate, this.taskFields.progress]}></AddDialogFieldDirective>
          <AddDialogFieldDirective type='Dependency'></AddDialogFieldDirective>
          <AddDialogFieldDirective type='Resources' fields={[this.resourceFields.id, this.resourceFields.name]}></AddDialogFieldDirective>
        </AddDialogFieldsDirective>
        <EditDialogFieldsDirective>
          <EditDialogFieldDirective type='General' headerText='General' fields={[this.taskFields.name, this.taskFields.startDate, this.taskFields.endDate, this.taskFields.progress]}></EditDialogFieldDirective>
          <EditDialogFieldDirective type='Dependency'></EditDialogFieldDirective>
          <EditDialogFieldDirective type='Resources' fields={[this.resourceFields.name]}></EditDialogFieldDirective>
        </EditDialogFieldsDirective>
</GanttComponent>

Thank you in advance.


Best regards,

Matteo Messmer



AK Alagumeena Kalaiselvan Syncfusion Team March 17, 2022 01:17 PM UTC

Hi matteomessmer, 

Greetings from Syncfusion support! 

We have checked your reported query and you can disable the touch swipe action by using actionComplete event of Gantt event as like below code. 

actionComplete(args) { 
      if (args.action == 'OpenDialog' && args.requestType == 'openEditDialog') { 
        var tabObj = document.getElementById("Editing_Tab"); 
        tabObj.ej2_instances[0].selecting = function (e) { 
          if (e.isSwiped) { 
            e.cancel = true;                   // To disable the Tab swipe action 
        } 
      } 
 } 


We have prepared the sample for your reference which can be get from following link 

Please get back to us, if you need further assistance 

Regards 
Alagumeena.K 


Marked as answer

MA matteomessmer March 21, 2022 07:44 PM UTC

Hi,
thank you it worked.
I had to change Editing_Tab to gantt_root_Tab, it seems that this ID is the GanttComponend ID concatenated with "_Tab".

    if (args.action == 'OpenDialog' && (args.requestType == 'openEditDialog' || args.requestType === "openAddDialog")) {
      var tabObj = document.getElementById("gantt_root_Tab");
      tabObj["ej2_instances"][0].selecting = function (e) {
        if (e.isSwiped) {
          e.cancel = true;                   // To disable the Tab swipe action
        }
      }
    }



RP Ranjani Prabakaran Syncfusion Team March 22, 2022 04:13 AM UTC

Hi Matteo
  
  
You are welcome. Please get back to us if you need any further assistance. 
  
  
Regards, 
  
Ranjani 
  


Loader.
Up arrow icon