How can you filter by two different items with Cascading Look up
One item is static and one is dynamic
I attempted the following
fd.spRendered(function() {
function filterLookup(v){
// getting the selected Category (0 if nothing is selected).
var categoryId = 0;
var task="Doorlist";
if (v) {
categoryId = isNaN(v) ? v.LookupId : v;
}
if (categoryId) {
// setting filtration
fd.field('Doors').filter = 'Task eq ' + task + 'and Site/Id eq ' + categoryId;
;
} else {
// resetting the filtration
fd.field('Doors').filter = null;
}
fd.field('Doors').widget.dataSource.read();
}
//filter Products when form opens
filterLookup(fd.field('Site').value);
//filter Products when Category changes
fd.field('Site').$on('change', function(value){
filterLookup(value);
fd.field('Doors').value = null;
});
});