EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: jkdoyle on May 14, 2020, 12:34:17 PM



Title: Datagrid Filter Mask
Post by: jkdoyle on May 14, 2020, 12:34:17 PM
Is there a way to add a filter to a datagrid mask?

I've tried using type: 'maskedbox' with options: {mask: '9999-99-99'} but that doesn't work.


Title: Re: Datagrid Filter Mask
Post by: jarry on May 14, 2020, 08:32:43 PM
Please extend the 'maskedbox' filter before using it.
Code:
$.extend($.fn.datagrid.defaults.filters, {
    maskedbox: {
        init: function(container, options){
            var input = $('<input>').appendTo(container);
            input.maskedbox(options);
            return input;
        },
        getValue: function(target){
            return $(target).maskedbox('getValue');
        },
        setValue: function(target, value){
            $(target).maskedbox('setValue', value);
        },
        resize: function(target, width){
            $(target).maskedbox('resize', width);
        }
    }
})