EasyUI Forum
November 29, 2025, 10:53:15 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: BUG tagbox in datagridfilter  (Read 182 times)
Vladzimir
Newbie
*
Posts: 9


View Profile
« on: November 23, 2025, 10:20:45 AM »

I use
Code:
    $.extend($.fn.datagrid.defaults.filters, {
        tagbox: {
            init: function (container, options) {
                var input = $('<input>').appendTo(container);
                input.tagbox($.extend({
                    selectOnNavigation: true,
                    panelHeight: 'auto',
                    hasDownArrow: true,
                    limitToList: true
                }, options || {}));
                console.log('init');
                return input;
            },
            setValue: function (target, value) {
                console.log('setValue');
                if (value) {
                    $(target).tagbox('setValues', value);

                } else {
                    $(target).tagbox('clear');
                }
            },
            getValue: function (target) {
                console.log('getValue');
                return $(target).tagbox('getValues');
            },
            resize: function (target, width) {
                console.log('resize');
                $(target).tagbox('resize', width);
            },
            destroy: function (target) {
                console.log('destroy');
                $(target).tagbox('destroy');
            }
        }
    });
$(target).tagbox('setValues', value); return bug
Code:
Uncaught TypeError: can't access property "textbox", $.data(...) is undefined
$(target).tagbox('clear'); return bug
Code:
Uncaught TypeError: can't access property "options", $.data(...) is undefined
Logged
Vladzimir
Newbie
*
Posts: 9


View Profile
« Reply #1 on: November 28, 2025, 12:09:43 PM »

This is a global error. It works even with textbox, but only when resetting the value.

Code:
$(target).textbox('setValue', '');

I fixed it using only
Code:
                try {
                    $(target).textbox('setValue', value);
                } catch (e) {
                }
or
Code:
                try {
                    $(target).tagbox('setValues', value);
                } catch (e) {
                }
Does anyone have any ideas as to why this is happening?
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!