Articles in this section
Category / Section

How to display the tasks based on the datasource field using dataManager

1 min read

In the Resourceview Gantt, it is possible to display the tasks based on the datasource field using the dataManager. This can be done by using the query property. Please refer the following code example for this.

<script type="text/javascript">
 
    var resourceGanttData = [
           { taskID: 1, taskName: "Plan timeline", startDate: new Date("02/06/2017"), endDate: new Date("02/10/2017"), duration: 5, progress: "50", resourceId: [1] , hide:false  },
           { taskID: 2, taskName: "Plan budget", startDate: new Date("02/13/2017"), endDate: new Date("02/17/2017"), duration: 5, progress: "50", resourceId: [1], hide:false },
           { taskID: 3, taskName: "Allocate resources", startDate: new Date("02/20/2017"), endDate: new Date("02/24/2017"), duration: 5, progress: "0", resourceId: [1], hide:false  },
           { taskID: 4, taskName: "Software Specification", startDate: new Date("02/10/2017"), endDate: new Date("02/12/2017"), duration: 5, progress: "0", resourceId: [2], hide:true  },
           { taskID: 5, taskName: "Develop prototype", startDate: new Date("02/10/2017"), endDate: new Date("02/12/2017"), duration: 5, progress: "0", resourceId: [2], hide:true  },
  ];
       $(function () {
            $("#resourceGantt").ejGantt({
                        dataSource: ej.DataManager(resourceGanttData),
                        query: ej.Query().where("hide", "equal", false, false),
                         //..
          });
      }); 
</script>

Sample:

A sample to display the tasks based on the datasource field using the dataManager in the Gantt is available here.

Note:

In the above sample, we have added the property called hide in the data source for all the tasks with proper value and rendered the records only if the field value has “false” in the Gantt by using the data manager and query property.

 

 

 

 

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied