Hello,
I'm trying to make a filter with two filters inside .. !!
I have a MultiSelect and AutoComplete and I want to take the value of them and put them in a filter...
so what I did is this...
in onChange_MultiSelect I wrote this...
var
filter = {
logic:
"or"
,
filters:
new
Array()
};
Global_Selected_Mitarbeiter_Filter = {
logic:
"or"
,
filters: filter.filters
};
scheduler.dataSource.filter(filter);
DataItems.forEach(
function
(item, index) {
// var itemToAdd =
// {
// Text: item.CrmUserNameZuordnung,
// Value: item.ID
// };
// selected.push(itemToAdd)
//for (var i = 0; i < selected.length; i++) {
for
(
var
i = 0; i < DataItems.length; i++) {
filter.filters.push({
field:
"CrmUserName"
,
operator:
"eq"
,
value: DataItems[i].CrmUserNameZuordnung
});
}
})
and in onChange_AutoComplete i wrote this ..
var
filter_All = {
logic:
"and"
,
filters:
new
Array()
};
var
filter = {
logic:
"or"
,
filters:
new
Array()
};
if
(auto_Change.value() !=
""
) {
filter_All.filters.push(filter);
}
if
(Mitarbeiter_MSelect.value() !=
""
) {
filter_All.filters.push(Global_Selected_Mitarbeiter_Filter);
}
scheduler.dataSource.filter(filter_All);
DataItemss.forEach(
function
(item, index) {
// var itemToAdd =
// {
// Text: item.Title
//Value: item.Title
//Color : item.color
// };
// selected.push(itemToAdd)
//for (var i = 0; i < selected.length; i++) {
for
(
var
i = 0; i < DataItemss.length; i++) {
filter.filters.push({
//2- this the title of the field of the multiselect it self .. like what to show as title for these fields
field:
"title"
,
operator:
"startswith"
,
//value: selected[i].Text
value: DataItemss[i].Title
});
}
})
so basically what I did is, putting the value in two filters and then push them into a third filter and try to filter the Scheduler...
but it's not working .. is there another way to approach this goal .. or any tip to make it right ??
Thanks in advance ...