EasyUI Forum
September 14, 2025, 06:53:56 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: How to make custom filter for data in the grid  (Read 6226 times)
wel
Newbie
*
Posts: 30


View Profile Email
« on: February 28, 2019, 02:38:58 PM »

I am just displaying the grid a standard way but I need to create custom filter like list data between two months only or two weeks . I know how to do that in PHP but how to filter the data displayed in the grid ?

Also is there UI tool I can use for this filter ?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #1 on: February 28, 2019, 07:27:17 PM »

This is the simple code that shows how to extend a filter component.
Code:
$.extend($.fn.datagrid.defaults.filters, {
    myfilter: {
        init: function(container, options){
            var cc = $('<span></span>').appendTo(container);
            //...
            return cc;
        },
        getValue: function(target){
            //return $(target).html();
        },
        setValue: function(target, value){
            //$(target).html(value);
        },
        resize: function(target, width){
            $(target)._outerWidth(width)._outerHeight(22);
        }
    }
})
Logged
wel
Newbie
*
Posts: 30


View Profile Email
« Reply #2 on: March 01, 2019, 01:16:49 PM »

any documentation to read more about this code ?
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!