HTML inputs as filters for DataTable using numbers instead of text

I want to filter my ID’s, which are are numbers and I have an input that is outside of the table. But I want to use the =, >,<,>=, and <= search criteria for numbers

datatable.filter(function(obj){
return obj.id.toString().indexOf(>200) != -1
});

is this possible?

Ok I realize how dumb this question is now.

I should return number(obj.id) which gives me a list of numbers to play with

Is there a way to use the numberFilter in a custom input?

I have a select that returns column id’s so I know what column they want to search, but if the column has numbers in it, I want to give them the ability to search by >, <, =, >=, and <=

So ideally the number filter that has that built in logic could be used. I just want it outside of the header.

Could someone at least post the code for the numberFilter un-minified so I can read it and maybe extend the functionality?

Unfortunately, it can’t be used in such way.

You can use a custom filtering function and just copy-paste logic from numberFilter, it is just a ten lines of code.

https://github.com/webix-hub/tracker/blob/master/codebase/webix_debug.js#L17696

Hmmmmmm is it possible to hide the built in numberFilter input with css, pass a val() to that input and fire off the keydown event? Problem is I cant seem to simulate a keydown event.

Figured it out

The filter function runs through all the data in the column with a for loop. It then looks for true or false. Any value that was true gets displayed in the column.

So if it is looking for true or false, we can easily use and if statement to check for conditions we want, and return true or false.

-------obj[colId] = the value in the cell, under my specified column---

-------userInputOperator = ">","<","==",">=", or "<="-------------

-------userInputNumber = the val() of the input -------------------
datatable.filter(function(obj){

      var evaluatedStatement = obj[colId] + userInputOperator + userInputNumber;
      if (eval(evaluatedStatement)) {return true} else {return false}; 
});