jQWidgets Forums

jQuery UI Widgets Forums Grid Custom comparison operators on filters

This topic contains 3 replies, has 2 voices, and was last updated by  ivailo 9 years, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author

  • Swagdiar
    Participant

    Is it possible to make my own custom filter option with something like “empty or null” like below? This code does not seem to work.

                    ready: function () {
                            var localizationObject = {
                            filterstringcomparisonoperators: ['empty or null', 'not empty','contains', 'does not contain'],
                            filternumericcomparisonoperators: ['less than', 'greater than'],
                            filterdatecomparisonoperators: ['less than', 'greater than'],
                            filterbooleancomparisonoperators: ['equal', 'not equal']
                            }
    
                            $(processingControlChangeReportSearchGrid).jqxGrid('localizestrings', localizationObject);
                            },
    
                    updatefilterconditions: function (type, defaultconditions) {
                            var stringcomparisonoperators =['EMPTY_OR_NULL', 'NOT_EMPTY', 'CONTAINS', 'DOES_NOT_CONTAIN'];
                            var numericcomparisonoperators =['LESS_THAN', 'GREATER_THAN'];
                            var datecomparisonoperators =['LESS_THAN', 'GREATER_THAN'];
                            var booleancomparisonoperators =['EQUAL', 'NOT_EQUAL'];
                            switch (type) {
                                case 'stringfilter':
                                    return stringcomparisonoperators;
                                case 'numericfilter':
                                    return numericcomparisonoperators;
                                case 'datefilter':
                                    return datecomparisonoperators;
                                case 'booleanfilter':
                                    return booleancomparisonoperators;
                            }
                    },

    ivailo
    Participant

    Hi Swagdiar,

    You can’t simply add your condition without setting any logic behind it.
    Instead you can create totally customized filter menu. Here is the demo how to do it.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com


    Swagdiar
    Participant

    Thanks, Ivailo. However, I do not see that demo using custom filter operators. How would I go about implementing them? Is it even supported?


    ivailo
    Participant

    Hi Swagdiar,

    You have to create your custom logic to filter columns according your needs.
    In this demo is demonstrated how to create your custom filter panel, combining fields about entering information and filter operators.

    It’s not supported creation of custom operators only (e.g. EMPTY_OR_NULL operator).

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.