Title: Datagrid filter issue on nested tabs [solved]
Post by: lcsft 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): too much recursion var d = opts.oldLoadFilter.call(this, data, parentId); I have the grid set up as: 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.
Title: Re: Datagrid filter issue on nested tabs
Post by: lcsft 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: 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) { .... } });
|