Filter resources fields Dialog gantt chart Vue

Hi, 

I can set this option by default on filter?


I can also hide the units from resources

Thanks



3 Replies

LG Logeswari Gopalakrishnan Syncfusion Team May 22, 2020 11:01 AM UTC

Hi Camilo, 
 
Thanks for contacting Syncfusion Support. 
  
Query 1: I can set this option by default on filter? 
  
We have achieved this by changing the order of operator in actionBegin event of treegrid. Please find the below code snippet. 
  
<ejs-gantt ref='gantt' id="GanttContainer"   
            ..//// 
 
            :actionComplete= "actionComplete" 
        > 
</ejs-gantt> 
../// 
 
methods: { 
            actionComplete: function(args) { 
                if (args.requestType === "openEditDialog" || args.requestType === "openAddDialog") { 
                   var tabObj = document.getElementById('GanttContainer_Tab').ej2_instances[0]; 
                   tabObj.selected = function(args){ 
                     if (args.selectedIndex === 2) { 
                      treeGrid.actionComplete = args => { 
              if ( 
                args.requestType === "filterafteropen" && 
                args.columnName === "resourceName" 
              ) { 
                var dropDown = document.getElementById( 
                  treeGrid.columns[2].uid + "-floptr" 
                ).ej2_instances[0]; 
                dropDown.index = 2; 
              } 
            };                     } 
                   } 
                } 
              } 
    }, 
  
  
Query 2: I can also hide the units from resources 
  
We have achieved this by using hideColumns method in actionComplete event. Please find the below code snippet. 
  
<ejs-gantt ref='gantt' id="GanttContainer"   
            ..//// 
 
            :actionComplete= "actionComplete" 
        > 
</ejs-gantt> 
../// 
 
methods: { 
            actionComplete: function(args) { 
                if (args.requestType === "openEditDialog" || args.requestType === "openAddDialog") { 
                   var tabObj = document.getElementById('GanttContainer_Tab').ej2_instances[0]; 
                   tabObj.selected = function(args){ 
                     if (args.selectedIndex === 2) { 
var treeGrid = document.getElementById('GanttContainerResourcesTabContainer').ej2_instances[0]; 
                      treeGrid.hideColumns(['Unit']); 
                     } 
                   } 
                } 
              } 
    }, 
  
  
Please find the below sample link. 
  
  
Please let us know if you need further details on this. 
  
Regards, 
Logeswari G 



CM Camilo Moreno replied to Logeswari Gopalakrishnan May 26, 2020 04:06 PM UTC

Hi Camilo, 
 
Thanks for contacting Syncfusion Support. 
  
Query 1: I can set this option by default on filter? 
  
We have achieved this by changing the order of operator in actionBegin event of treegrid. Please find the below code snippet. 
  
<ejs-gantt ref='gantt' id="GanttContainer"   
            ..//// 
 
            :actionComplete= "actionComplete" 
        > 
</ejs-gantt> 
../// 
 
methods: { 
            actionComplete: function(args) { 
                if (args.requestType === "openEditDialog" || args.requestType === "openAddDialog") { 
                   var tabObj = document.getElementById('GanttContainer_Tab').ej2_instances[0]; 
                   tabObj.selected = function(args){ 
                     if (args.selectedIndex === 2) { 
                      treeGrid.actionComplete = args => { 
              if ( 
                args.requestType === "filterafteropen" && 
                args.columnName === "resourceName" 
              ) { 
                var dropDown = document.getElementById( 
                  treeGrid.columns[2].uid + "-floptr" 
                ).ej2_instances[0]; 
                dropDown.index = 2; 
              } 
            };                     } 
                   } 
                } 
              } 
    }, 
  
  
Query 2: I can also hide the units from resources 
  
We have achieved this by using hideColumns method in actionComplete event. Please find the below code snippet. 
  
<ejs-gantt ref='gantt' id="GanttContainer"   
            ..//// 
 
            :actionComplete= "actionComplete" 
        > 
</ejs-gantt> 
../// 
 
methods: { 
            actionComplete: function(args) { 
                if (args.requestType === "openEditDialog" || args.requestType === "openAddDialog") { 
                   var tabObj = document.getElementById('GanttContainer_Tab').ej2_instances[0]; 
                   tabObj.selected = function(args){ 
                     if (args.selectedIndex === 2) { 
var treeGrid = document.getElementById('GanttContainerResourcesTabContainer').ej2_instances[0]; 
                      treeGrid.hideColumns(['Unit']); 
                     } 
                   } 
                } 
              } 
    }, 
  
  
Please find the below sample link. 
  
  
Please let us know if you need further details on this. 
  
Regards, 
Logeswari G 


Thanks, it's perfect 


PP Pooja Priya Krishna Moorthy Syncfusion Team May 27, 2020 02:48 AM UTC

Hi Camilo, 
Most welcome.  
Please get back to us if you would require further assistance on this. 

Regards, 
Pooja K. 


Loader.
Up arrow icon