Make ExtJS filter `int` using comparison` equal`

I use ExtJS in one old (and not mine) project, and I need to debug it.
Therefore, I have this code in the search form:

 var pm = Ext.getCmp('ddlFltrPM').getValue(); if(pm && pm > 0) filters.push({dataIndex: 'project_manager_id', type: 'string', value: pm}); 

This works, but in php code, the function converts this filter into a sql query as follows:
AND project_manager_id LIKE %...% (default conversion function), because it is a string search.

But I need an exact match . Therefore, when I try something like this:

 var pm = Ext.getCmp('ddlFltrPM').getValue(); if(pm && pm > 0) filters.push({dataIndex: 'project_manager_id', type: 'int', comparison:'eq', value: pm}); 

.. the filter does not appear in POST. I tried a lot of type and comparison options, but nothing works.

So, how can I change this filter field to int using eq comparison?

Thanks for your suggestions.
Stanislav.

+4
source share
1 answer

I solved this problem. But it was difficult to debug ExtJS code step by step. So the code:

 var pm = Ext.getCmp('ddlFltrPM').getValue(); if(pm && pm > 0) filters.push({dataIndex: 'project_manager_id', type: 'int', value: {"eq":pm}}); 
+4
source

Source: https://habr.com/ru/post/1447693/


All Articles