EasyUI Forum
May 02, 2024, 12:36:33 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 Filter Mask  (Read 2647 times)
jkdoyle
Newbie
*
Posts: 25


View Profile Email
« 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.
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 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);
        }
    }
})
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!