The following demo illustrates how to filter the tasks inside the GanttChart component. Two types of filtering are available: default and advanced( via the filterRow). The default filtering mode filters all columns based on their cell values. Cell value might not be the same as the cell's actual content that appear inside the Table. The cell value is determined by the column settings defined in the taskColumn property. For example, the Priority column uses a formatFunction to display the priority labels ('Low', 'Medium', 'High') instead of the actual numeric values that represent them. The filtering is applied on the numeric values of the column since they represent the actual priority of the task.
A live JavaScript/jQuery example of jqxGantt, the jQWidgets Gantt component, with its complete source code below. It is one of 15 jqxGantt demos for jQuery.
source property – Determines the tasks that will be loaded inside the Timeline.dateStart property – Determines a specific starting date for the Timeline.durationUnit property – Determines in what unit is task duration property measured.hideTimelineHeaderDetails property – By default the Timeline has a three level header - timeline details, timeline second details and timeline header.tasks property – A getter that returns a flat structure as an array of all tasks inside the element.taskColumns property – Determines the columns that will be visible in the Task Tree.taskFiltering property – Determines whether the Task Table is filterable or not.treeMin property – Determines the min width of the task table.view property – Determines the viewing date range of the timeline.To run it in your own page, load jqx.base.css, a theme and the library files below from npm (npm install jqwidgets-scripts) or the jsDelivr CDN, then add the markup and the script. jQuery is not required: jqxcore.js provides $.
The page loads jqx.base.css, a theme and these library files: jqxcore.js, jqxgantt.js, jqxgantt.api.js, jqxbuttons.js, jqxscrollbar.js, jqxlistbox.js, jqxdropdownlist.js.
It also loads helper scripts of this demo site, which are not part of the library: demos.js (getWidth() and other layout helpers).
window.onload = () => {
const gantt = new jqwidgets.createInstance('#gantt', 'jqxGantt', {
view: 'week',
durationUnit: 'day',
treeMin: 300,
taskFiltering: true,
hideTimelineHeaderDetails: true,
taskColumns: [
{
label: 'Tasks',
value: 'label',
size: '40%'
},
{
label: 'Start Time',
value: 'dateStart',
size: '30%'
},
{
label: 'Priority',
value: 'value',
customEditor: function (label, value) {
const container = document.createDocumentFragment();
const labelElement = document.createElement('label');
const dropDownList = document.createElement('div');
labelElement.textContent = 'Priority';
$(dropDownList).jqxDropDownList({
popupZIndex: 9999,
source: [{ label: 'Low', value: 0 },
{ label: 'Medium', value: 1 },
{ label: 'High', value: 2 }]
})
dropDownList.selectedIndex = value;
container.appendChild(labelElement);
container.appendChild(dropDownList);
return container;
},
setCustomEditorValue: function (editor, label, value) {
$(editor.querySelector('.jqx-dropdownlist')).val(value);
},
getCustomEditorValue: function (editor) {
return $(editor.querySelector('.jqx-dropdownlist')).val();
},
formatFunction: (value) => ['Low', 'Medium', 'High'][value]
}
],
source: [
{
label: 'Project A',
value: 1,
class: 'priority-medium',
dateStart: '2026-04-27',
duration: 20,
expanded: true,
type: 'project',
tasks: [
{
label: 'Task A',
value: 2,
class: 'priority-high',
dateStart: '2026-04-29',
duration: 5,
connections: [{
target: 5,
type: 1
}],
},
{
label: 'Project A-1',
value: 2,
class: 'priority-high',
dateStart: '2026-04-28',
duration: 10,
expanded: true,
type: 'project',
tasks: [
{
label: 'Task B',
value: 1,
class: 'priority-medium',
dateStart: '2026-05-01',
duration: 3
},
{
label: 'Task B-1',
value: 0,
class: 'priority-low',
dateStart: '2026-05-02',
duration: 2
},
{
label: 'Task B-2',
value: 2,
class: 'priority-high',
dateStart: '2026-05-4',
duration: 3
},
{
label: 'Task B-3',
value: 2,
class: 'priority-high',
dateStart: '2026-05-06',
duration: 4
},
{
label: 'Task B-4',
value: 1,
class: 'priority-medium',
dateStart: '2026-05-06',
duration: 4
}
]
},
{
label: 'Project A-2',
value: 0,
class: 'priority-low',
dateStart: '2026-05-01',
duration: 8,
expanded: true,
type: 'project',
tasks: [
{
label: 'Task C',
value: 0,
class: 'priority-low',
dateStart: '2026-05-01',
duration: 4,
connections: [{
target: 10,
type: 1
},
{
target: 11,
type: 1
}]
},
{
label: 'Task C-1',
value: 0,
class: 'priority-low',
dateStart: '2026-05-06',
duration: 4
},
{
label: 'Task C-2',
value: 1,
class: 'priority-medium',
dateStart: '2026-05-07',
duration: 3,
connections: [{
target: 12,
type: 1
}]
},
{
label: 'Task C-3',
value: 1,
class: 'priority-medium',
dateStart: '2026-05-08',
duration: 2
}
]
}
]
}
]
});
};
<p>The following demo illustrates how to filter the tasks inside the GanttChart component. Two types of filtering
are avaialble: default and
advanced( via the <b>filterRow</b>). The default filtering mode filters all columns based
on
their cell values. Cell value might not be the same as the cell's actual content that appear inside the Table.
The cell value is determined by the column settings defined in the <b>taskColumn</b>
property. For example, the <u>Priority</u> column uses a <b>formatFunction</b> to display the priority
labels ('Low', 'Medium', 'High') instead of the actual numeric values that represent them. The filtering is
applied on the numeric
values of the column since they represent the actual priority of the task.</p>
<div id="gantt"></div>
<div style="position: absolute; bottom: 5px; right: 5px;">
<a href="https://www.jqwidgets.com/" alt="https://www.jqwidgets.com/"><img alt="https://www.jqwidgets.com/" title="https://www.jqwidgets.com/" src="https://www.jqwidgets.com/wp-content/design/i/logo-jqwidgets.png"></a>
</div>