EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: wel on February 28, 2019, 02:38:58 PM



Title: How to make custom filter for data in the grid
Post by: wel 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 ?


Title: Re: How to make custom filter for data in the grid
Post by: jarry 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);
        }
    }
})


Title: Re: How to make custom filter for data in the grid
Post by: wel on March 01, 2019, 01:16:49 PM
any documentation to read more about this code ?