Our state of the art Gantt chart


Post by rayudu.pasumarthy »

Hi,

We would like to know if it is possible to unfilter a task before executing scrollRowIntoView.
For example, adding below code in console of advanced example (https://bryntum.com/examples/gantt/advanced/):

gantt.taskStore.allRecords.forEach(task => console.log(task.name, task.id))
gantt.taskStore.filter({
    id: 'filterByType',
    property: 'duration', 
    operator: '=',
    value: 2
})
if (gantt.taskStore.isAvailable(11) == false) {
	// Unfilter Install Apache
} 
gantt.scrollRowIntoView(gantt.taskStore.getById(11))

Is it possible to unfilter 'Install Apache' (TaskID : 11) and then execute scrollRowIntoView?

Thanks,
Rayudu


Post by mats »

No, you would have to change to using a filter function which can also not filter out your tasks that you want to scroll to.


Post by rayudu.pasumarthy »

Hi Mats, thanks for your reply.

By changing the filter function, does it mean that all our filters needs to have an extra condition to not include specific tasks like below:

const excludeRecords = ['2e714c7d-8ca2-41c3-80d0-5bb1149b002f']
gantt.taskStore.addFilter({
          id: 'abcFilter',
          filterBy: record => record.taskStatusId != 1 || excludeRecords.includes(record.id)
        }, true);
gantt.taskStore.addFilter({
          id: 'xyzFilter',
          filterBy: record => record.taskStatusId != 2 || excludeRecords.includes(record.id)
        }, true);
gantt.taskStore.filter();

Or can we have a separate filter that excludes particular tasks at the end?

const excludeRecords = ['2e714c7d-8ca2-41c3-80d0-5bb1149b002f']
gantt.taskStore.addFilter({
          id: 'abcFilter',
          filterBy: record => record.taskStatusId != 1
        }, true);
gantt.taskStore.addFilter({
          id: 'xyzFilter',
          filterBy: record => record.taskStatusId != 2
        }, true);
gantt.taskStore.addFilter({
          id: 'excludeFilter',
          filterBy: record => {
		// condition to exclude specific Records
	}
        }, true);
gantt.taskStore.filter();

If the below is possible, what could be the condition that bryntum would allow us to set?

Thanks,
Rayudu.


Post by alex.l »

There is no special filters for excluding, so you have to define a method for your filter that will do the job..

All the best,
Alex


Post Reply