Please extend a new operator to filter multiple values.
$.extend($.fn.datagrid.defaults.operators, {
mequal: {
text: 'Equal',
isMatch: function (source, value) {
const vv = value.split(',');
const index = vv.indexOf(source);
return index != -1;
}
}
})
And then apply it to your code.
onChange: function (value) {
if (value == '') {
dg_HW.datagrid('removeFilterRule', 'Year');
} else {
dg_HW.datagrid('addFilterRule', {
field: 'Year',
op: 'mequal',
value: value.join(',')
});
}
dg_HW.datagrid('doFilter');
}