EasyUI Forum
March 28, 2024, 04:11:13 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: Datagrid filter issue on nested tabs [solved]  (Read 5247 times)
lcsft
Newbie
*
Posts: 7


View Profile
« on: February 11, 2015, 01:56:40 AM »

Hello,

I am using a datagrid with the filter extension inside nested tabs, and I have the following issue:
when I enter any value to any field, I get the following error (datagrid-filter.js):
Code:
too much recursion
var d = opts.oldLoadFilter.call(this, data, parentId);

I have the grid set up as:
Code:
jQuery(grid).datagrid({
        width: '100%',
        height: 450,
        singleSelect: true,
        idField: 'id',
        
        fitColumns: true,
        multiSort: true,
        
        url: '.....',
        remoteSort: true,
        pagination: true,
        remoteFilter: true,
        
        /* Columns */
        columns:[[
                 {field: 'date', title:'{{lang:grid_col_actdate}}', width: '20%', sortable:true, required:true, formatter:fn_datebox_formatter,
                    editor: { type: 'datebox', options: { required:true, formatter: fn_datebox_formatter, parser: fn_datebox_parser } }
                 },
                 {field: 'time', title:'{{lang:grid_col_acthour}}', width: '20%', sortable:true,
                    editor: {type:'textbox', options: {validType:'time',required:true} }
                 },
                 {field: 'max_persons', title: '{{lang:grid_col_max_persons}}', width: '10%', sortable:true,
                    editor: {type:'numberbox', options: {min:0, precision:0, required:true} }
                 },
                 {field: 'booked', title: '{{lang:grid_col_booked}}', width: '10%', sortable:true},
                 {field: 'canceled', title: '{{lang:grid_col_canceled}}', width: '8%', align:'center', sortable:true, formatter: fn_datagrid_cancelCell,
                    editor:
                    {
                        type:'checkbox',
                        options: { on: '1', off: '' }
                    }
                 }
                ]]
    });
    setTimeout(function(){
        jQuery(grid).datagrid('enableFilter');
    }, 1000);
}
* the settimeout is needed (as I noticed) for the delayed load inside nested tabs, when the grid is on a tab that is not visible at load.

thank you.
« Last Edit: February 18, 2015, 12:53:39 AM by lcsft » Logged
lcsft
Newbie
*
Posts: 7


View Profile
« Reply #1 on: February 11, 2015, 07:46:13 AM »

Ok, I  found the problem,
I have the tab system executing a certain event from the tab content that loads via ajax.
The problem is that the tabs('add',{ href = .. , ... onLoad: function(panel) { console.log('onload called') }, ... }.
what's inside the onLoad it called twice, so I have my init function called twice, so the filter on the grid is applied twice...
I don't know if this is a bug or it is supposed to work like this. I have my init as follows:
Code:
var mtabs = jQuery('#main_tabs').tabs('add',{
title: title,
href: url,
iconCls: icon,
closable: closable,
cache: true,
onLoad: function(panel) { initTabContent(this); /* this is called twice */ },
onLoadError: function(XMLHttpRequest, textStatus, errorThrown) { .... }
});
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!