jQWidgets Forums

jQuery UI Widgets Forums Grid Problem With updatefilterpanel in Grid

This topic contains 2 replies, has 2 voices, and was last updated by  Sibeesh Venu 9 years, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Problem With updatefilterpanel in Grid #77784

    Sibeesh Venu
    Participant

    Suppose I have a grid as follows,

     $("#jqxgrid").jqxGrid(
                      {
                          source: data,
                          columns: [{ "text": "Area Code", "dataField": "AreaCode", "cellsalign": "left", "cellsformat": "d" }, { "text": "Revenue", "dataField": "Revenue", "cellsalign": "right", "cellsformat": "c2" }],
                          pageable: true,
                          filterable: true,
                          sortable: true,
                          rendered: function () {
                              var localizationobj = {};
                              filterstringcomparisonoperators = ['equal', 'empty', 'not empty', 'contains', 'does not contain', 'starts with', 'ends with', 'null'];
                              filternumericcomparisonoperators = ['equal', 'not equal', 'less than', 'less than or equal', 'greater than', 'greater than or equal', 'null', 'not null'];
                              filterdatecomparisonoperators = ['equal', 'not equal', 'less than', 'less than or equal', 'greater than', 'greater than or equal', 'null', 'not null'];
                              filterbooleancomparisonoperators = ['equal', 'not equal'];
    
                              localizationobj.filterstringcomparisonoperators = filterstringcomparisonoperators;
                              localizationobj.filternumericcomparisonoperators = filternumericcomparisonoperators;
                              localizationobj.filterdatecomparisonoperators = filterdatecomparisonoperators;
                              localizationobj.filterbooleancomparisonoperators = filterbooleancomparisonoperators;
    
                              // apply localization.
                              $("#jqxgrid").jqxGrid('localizestrings', localizationobj);
                          },
                          updatefilterconditions: function (type, defaultconditions) {
                              var stringcomparisonoperators = ['EQUAL', 'EMPTY', 'NOT_EMPTY', 'CONTAINS', 'DOES_NOT_CONTAIN', 'STARTS_WITH', 'ENDS_WITH', 'NULL'];
                              var numericcomparisonoperators = ['EQUAL', 'NOT_EQUAL', 'LESS_THAN', 'LESS_THAN_OR_EQUAL', 'GREATER_THAN', 'GREATER_THAN_OR_EQUAL', 'NULL', 'NOT_NULL'];
                              var datecomparisonoperators = ['EQUAL', 'NOT_EQUAL', 'LESS_THAN', 'LESS_THAN_OR_EQUAL', 'GREATER_THAN', 'GREATER_THAN_OR_EQUAL', 'NULL', 'NOT_NULL'];
                              var booleancomparisonoperators = ['EQUAL', 'NOT_EQUAL'];
                              switch (type) {
                                  case 'stringfilter':
                                      return stringcomparisonoperators;
                                  case 'numericfilter':
                                      return numericcomparisonoperators;
                                  case 'datefilter':
                                      return datecomparisonoperators;
                                  case 'booleanfilter':
                                      return booleancomparisonoperators;
                              }
                          },
                          updatefilterpanel: function (filtertypedropdown1, filtertypedropdown2, filteroperatordropdown, filterinputfield1, filterinputfield2, filterbutton, clearbutton,
                               columnfilter, filtertype, filterconditions) {
                              var index1 = 0;
                              var index2 = 0;
                              filtertypedropdown1.jqxDropDownList({ autoDropDownHeight: true, selectedIndex: index1 });
                              filtertypedropdown2.jqxDropDownList({ autoDropDownHeight: true, selectedIndex: index2 });
                          }
                      });

    My requirement was showing equal as the default condition in filter, So I used updatefilterpanel. But now I have selected filter ‘Contains’ and apply filter. When I click on the applied filter and check, the condition is showing ‘Equal’ Instead of ‘Contains’ . I wanted the Equal conditions to be showed if there is no filters applied to that column. Any suggestions? Thanks in advance.

    Kindest Regards
    Sibeesh Venu

    Problem With updatefilterpanel in Grid #77791

    Peter Stoev
    Keymaster

    Hi Sibeesh Venu,

    You’re posting the same topic for 3rd time. Please, see our answers to the previous topics.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    Problem With updatefilterpanel in Grid #77797

    Sibeesh Venu
    Participant
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.