EasyUI Forum
May 05, 2024, 06:24:00 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: Filters on columns with formatters  (Read 8985 times)
A-K
Full Member
***
Posts: 122


View Profile WWW
« on: July 08, 2015, 10:55:51 PM »

Hey,

How can I make the filters to work on columns with formatters? I prefer having this with the fast filter that filters when you type.

Also, can I show the filter only on specific columns and not all of them when "enable: Filter" is added?

Thanks!
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: July 09, 2015, 07:24:16 AM »

To hide the filter, just set the filter type to 'label', or set the 'defaultFilterType' property to 'label' and enable what fields you want to filter.
Code:
var dg = $('#dg').datagrid({
defaultFilterType:'label'
});
dg.datagrid('enableFilter', [{
field:'listprice',
type:'numberbox',
options:{precision:1},
op:['equal','notequal','less','greater']
},{
field:'unitcost',
type:'numberbox',
options:{precision:1},
op:['equal','notequal','less','greater']
},{
field:'attr1',
type:'label'
},{
field:'status',
type:'label'
}]);
Logged
A-K
Full Member
***
Posts: 122


View Profile WWW
« Reply #2 on: July 09, 2015, 08:39:03 AM »

Works great!

Can you also tell me how to make the filter to work on columns with formatters? This is my main issue.

Thanks.
Logged
A-K
Full Member
***
Posts: 122


View Profile WWW
« Reply #3 on: July 11, 2015, 12:47:32 AM »

stworthy, Could you help out with this?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #4 on: July 11, 2015, 02:45:49 AM »

Please try to download the 'datagrid-filter.js' file from http://www.jeasyui.com/extension/datagrid_filter.php
Logged
A-K
Full Member
***
Posts: 122


View Profile WWW
« Reply #5 on: July 11, 2015, 02:53:09 AM »

Thanks! I didnt know you updated the filters to work on formatters.
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!