Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
Does the Filtering API allow filtering using the predefined customConditions
posted

Is it possible to enable or disable customConditions filters via the filtering API?  I have several columns with customConditions defined (Example Below) but do not see any way to apply these with the API.  

 Ex Colum Filter Definition:

	{ columnKey: "classification", condition: "doesNotEqual", allowFiltering: true, customConditions:
		{
			Unclassified: { key: 'Unclassified', 'Unclassified', expressionText: "Unclassified", filterFunc: function (value) {  return value.includes("Unclassified"); } },
			ClassA: { key: 'ClassA', labelText: 'ClassA', expressionText: "AccountChanges", filterFunc: function (value) { return value.includes("ClassA"); } },
			ClassB: { key: 'ClassB', labelText: 'ClassB', expressionText: "ZeroAmount", filterFunc: function (value) {  return value.includes("ClassB"); } }
		}
	}

Does the API offer any way for me to enable one of the above filters?  I only see a way to define a new filter via the API as shown below.

$("#Grid").igGridFiltering("filter", ([{ fieldName: "classification", expr: "ClassA", cond: "equal" }]), true); 

Thanks in advance!

Regards,
Matt

Parents
No Data
Reply
  • 1300
    Verified Answer
    Offline posted

    Hello Matt,

    After investigating this further, I have determined that the custom filter conditions could be applied the same way as the default ones. This could be achieved by defining the custom filter and using the filter method as follows:

    function applyUSAFilter(){

              $("#gridCustomConditions").igGridFiltering("filter", ([{fieldName: "Country", cond: "USA", logic: "AND"}]));

            }

    I have created a small sample, demonstrating the described behavior. Please test it on your side and let me know if you need any further information regarding this matter.

    Regards,
    Monika Kirkova,
    Infragistics

Children