I am trying to apply filter for my grid. It is working fine for normal data in the grid but it is not working for array of array data in the grid. I am using template for rendering the grid data.
Kindly suggest some way to resolve this issue as soon as possible. In below example filter is working for productnumberlist but not working for daterangelist and intelWwlist.
var _daterangelist = [];
var _productnumberlist = [];
var _intelWwlist = [];
this.setDaterangelist = function(input){
_daterangelist = input;
}
this.setProductnumberlist = function(input) {
_productnumberlist = input;
}
this.setIntelWwlist = function(input){
_intelWwlist = input;
}
this.assuranceGridOptions = function () {
var selectTemplate = '<input type="checkbox" class="wom-md-checkbox"/>',
customerPartNumberTemplate = '',
intelProductNumberTemplate = '<span>{{dataItem.productNumber | trimLeadingZero}}</span>',
intelProductNameTemplate = '',
intelProcessorNumberTemplate = '',
intelWwTemplate = '#ln=availablelist.length;for (var i = 0; i< ln; i++) {#<span>#="WW"+(availablelist[i].workweek).slice(4)#</span><br>#}#',
dateRangeTemplate = '#ln=availablelist.length;for (var i = 0; i< ln; i++) {#<span>#=availablelist[i].startdate + " To " + availablelist[i].enddate#</span><br>#}#',
requestedQtyTemplate = '#ln=availablelist.length;for (var i = 0; i< ln; i++) {#<span>#=availablelist[i].quantity#</span><br>#}#',
plantTemplate = '#ln=availablelist.length;for (var i = 0; i< ln; i++) {#<span>#=availablelist[i].plant#</span><br>#}#';
var columnStyle = "text-align: center; font-size: 14px; white-space: normal; overflow: visible",
headerStyle = 'text-align: center; font-size: 14px; overflow: visible';
var searchResultsGrid = {
columns: [
{
field: '',
title: '',
width: '50px',
headerAttributes: {style: headerStyle},
attributes: {style: columnStyle},
template: selectTemplate
},
{
field: 'cpn',
title: 'Customer Part #',
headerAttributes: {style: headerStyle},
attributes: {style: columnStyle},
template: customerPartNumberTemplate
},
{
field: 'prodNum',
title: 'Intel Product #',
headerAttributes: {style: headerStyle},
attributes: {style: columnStyle},
template: intelProductNumberTemplate,
filterable: {ui: productnumberFilter}
},
{
field: 'productName',
title: 'Intel Product Name',
headerAttributes: {style: headerStyle},
attributes: {style: columnStyle},
template: intelProductNameTemplate
},
{
field: 'processorNumber',
title: 'Processor #',
headerAttributes: {style: headerStyle},
attributes: {style: columnStyle},
template: intelProcessorNumberTemplate
},
{
field: 'intelWw',
title: 'Intel WW',
headerAttributes: {style: headerStyle},
attributes: {style: columnStyle},
template: intelWwTemplate,
filterable: {ui: intelWwFilter}
},
{
field: 'dateRange',
title: 'Date Range',
width: 210,
headerAttributes: {style: headerStyle},
attributes: {style: columnStyle},
template: dateRangeTemplate,
filterable: {ui: dateRangeFilter}
},
{
field: 'quantity ',
title: 'Qty',
headerAttributes: {style: headerStyle},
attributes: {style: columnStyle},
template: requestedQtyTemplate
},
{
field: 'plant',
title: 'Plant',
headerAttributes: {style: headerStyle},
attributes: {style: columnStyle},
template: plantTemplate
}
],
columnMenu: true,
pageable: true,
noRecords: {
template: "No record found. Please contact your Intel representative for supply assurance information."
},
filterable: {
extra: false,
operators: {
string: {
contains: "Contains",
startswith: "Starts with",
eq: "Is equal to",
neq: "Is not equal to"
}
}
},
dataSource: new kendo.data.DataSource({
selectable: "",
transport: {
read: {
dataType: "json",
cache: false
}
},
schema: {
parse: function (d) {
for (var i = 0; i < d.length; i++) {
if (d[i]) {
return d[i];
}
}
return [];
},
},
filter: {
}
})
};
return searchResultsGrid;
}
this.getEmptyLineItem = function () {
return {
orderID: "",
cpn: "",
intelProductNumber: "",
intelProductName: "",
intelProcessorNumber: "",
intelWw: "",
dateRange: "",
requestedQty: "",
plant: ""
}
}
function productnumberFilter(element) {
element.kendoDropDownList({
dataSource: _productnumberlist,
optionLabel: "--Select Value--"
});
}
function dateRangeFilter(element) {
element.kendoDropDownList({
dataSource: _daterangelist,
optionLabel: "--Select Value--"
});
}
function intelWwFilter(element){
element.kendoDropDownList({
dataSource: _intelWwlist,
optionLabel: "--Select Value--"
});
}