EasyUI Forum
April 20, 2024, 12:06:34 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Datagrid client side filtering is not working  (Read 8533 times)
rangaNadha
Jr. Member
**
Posts: 50


View Profile
« on: August 02, 2018, 01:50:19 AM »

Hi,

I tried to configure the client side filtering in Datagrid, it is giving the below exception.

Current Datagrid configuration

Code:
table.datagrid({
pagination:true,
        remoteSort:false,
        remoteFilter:false,
pageSize: 10,
loadMsg:$("#gridProcessing").text(),
url:"getList.htm",
onLoadError: function(){
table.datagrid('loadData',[]);
},
view: main.noRecordsView,
});

Below exception I am getting with the existing datagrid-filters.js file
Code:
Uncaught TypeError: Cannot read property 'isMatch' of undefined
    at isMatch (datagrid-filter.js:129)
    at HTMLTableElement.filterMatcher (datagrid-filter.js:104)
    at HTMLTableElement.myLoadFilter (datagrid-filter.js:447)
    at HTMLTableElement.opts.loadFilter (datagrid-filter.js:562)
    at _612 (jquery.easyui.min.js:9003)
    at HTMLTableElement.<anonymous> (jquery.easyui.min.js:9894)
    at Function.each (jquery-1.11.1.min.js:2)
    at m.fn.init.each (jquery-1.11.1.min.js:2)
    at Object.loadData (jquery.easyui.min.js:9893)
    at Object.$.fn.datagrid.methods.loadData (datagrid-filter.js:24)

I tried with the latest datagrid-filter.js from the below url, still i am getting the same exception
http://www.jeasyui.com/extension/datagrid_filter.php

Code:
Uncaught TypeError: Cannot read property 'isMatch' of undefined
    at isMatch (datagrid-filter.js:228)
    at HTMLTableElement.filterMatcher (datagrid-filter.js:193)
    at HTMLTableElement.myLoadFilter (datagrid-filter.js:637)
    at HTMLTableElement.opts.loadFilter (datagrid-filter.js:778)
    at _612 (jquery.easyui.min.js:9003)
    at HTMLTableElement.<anonymous> (jquery.easyui.min.js:9894)
    at Function.each (jquery-1.11.1.min.js:2)
    at m.fn.init.each (jquery-1.11.1.min.js:2)
    at Object.loadData (jquery.easyui.min.js:9893)
    at Object.loadData (datagrid-filter.js:36)

Please help to fix this issue.

Thanks,
Pandu Ranga T.
Logged
rangaNadha
Jr. Member
**
Posts: 50


View Profile
« Reply #1 on: August 02, 2018, 02:24:58 AM »

I have debugged the code in chrome, actually by default the operator is "Contains" in the isMatch function it is comparing with the list of operators. It is failing there.

I have set the below properties to the datagrid configuration

defaultFilterOperator: 'equal',
defaultFilterType: 'textbox',

It is working if the value matches in the rows, but I want to filter the data with "contains" only.

Can anyone suggest what configuration I need to change?
Logged
lloyd
Newbie
*
Posts: 29


View Profile Email
« Reply #2 on: August 02, 2018, 07:03:20 AM »

Try setting:
filterMatchingType: 'any'

There is no need to set
defaultFilterType or defaultFilterOperator
as the defaults are:-
defaultFilterType: 'text' (not 'textbox')
defaultFilterOperator:  'contains'

Logged
rangaNadha
Jr. Member
**
Posts: 50


View Profile
« Reply #3 on: August 02, 2018, 07:14:47 AM »

It's not working lloyd.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #4 on: August 03, 2018, 12:03:37 AM »

Please look at this example http://code.reloado.com/uwimul3/edit#preview. It works fine.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!