Grid Fileter for OR Logic is not working

In 4.1.2 version:

I want to customize the grid text filter from ‘And(&)’ Logic to ‘OR(||)’ Logic. I saw your documentation reference. docs.dhtmlx.com/grid__filtering. … ntheheader.

that contains implementation of ‘OR’ logic by extending filterByAll() i am following the same procedure as in reference but it gives exception like

TypeError: this._settings is undefined
return this.rowsBuffer[ind]?this.rowsBuffer[ind].idd:this.undefined}

‘filter(data)’ gives exception

My grid has 8 columns I want to filter using or logic and my implementation is
gridobj1.setHeader("tem1,tem2 ,tem3 ,tem4 ,tem5 ,tem6 ,tem7 ,tem8 ");
gridobj1.setColumnIds(“tem1,tem2 ,tem3 ,tem4 ,tem5 ,tem6 ,tem7 ,tem8 “);
gridobj1.setColTypes(“ro,ro,ro,ro,ro,ro,ro,ro”);
gridobj1.attachHeader(”#text_filter,#text_filter,#text_filter,#text_filter,#text_filter,#text_filter,#text_filter,#text_filter”);

gridobj1.init();

gridobj1.filterByAll = function() {
var tem1= this.getFilterElement(0).value;
var tem2 = this.getFilterElement(1).value;
var tem3 = this.getFilterElement(2).value;
var tem4 = this.getFilterElement(3).value;
var tem5 = this.getFilterElement(4).value;
var tem6 = this.getFilterElement(5).value;
var tem7 = this.getFilterElement(6).value;
var tem8 = this.getFilterElement(7).value;
//unfilters if values were not selected
if (!tem1&& !tem2 && !tem3 && !tem4 && !tem5 && !tem6 && !tem7 && !tem8 ) {
return this.filter();
}
//filters using OR logic
this.filter(function(data) {
if (data == tem1|| data == tem2 || data == tem3 || data == tem4 || data == tem5 || data == tem6|| data == tem7 || data == tem8 ) {
return true;
}
if (data != -1) {
return true;
}
return false;
});
};

I apologize. There is a mistake in the documentation. In case of this.filter() you should use the filterBy() method.
Please, try to use the following code:

myGrid.filterByAll=function(){ //gets filter values var tem1= this.getFilterElement(0).value; var tem2 = this.getFilterElement(1).value; var tem3 = this.getFilterElement(2).value; var tem4 = this.getFilterElement(3).value; var tem5 = this.getFilterElement(4).value; var tem6 = this.getFilterElement(5).value; var tem7 = this.getFilterElement(6).value; var tem8 = this.getFilterElement(7).value; //unfilters if values were not selected if (!title && !year) return this.filterBy(0); //filters using OR logic this.filterBy(0, function(data,id){ if (this.cells(id, 0).getValue()== tem1) return true; if (this.cells(id, 1).getValue()== tem2) return true; if (this.cells(id, 2).getValue()== tem3) return true; if (this.cells(id, 3).getValue()== tem4) return true; if (this.cells(id, 4).getValue()== tem5) return true; if (this.cells(id, 5).getValue()== tem6) return true; if (this.cells(id, 6).getValue()== tem7) return true; if (this.cells(id, 7).getValue()== tem8) return true; return false; }); };

Thank you :smiley: