|
Title: Datagrid onAfterRender event finds no columns Post by: glarsen on August 01, 2014, 09:13:00 AM Hi,
There is a panel which contains a datagrid created by the script. Once it exists I can resize the panel based on the datagrid column widths using this selector: var cols = $('#' + g).find('.datagrid-header-row').children(); Problem is there are no cols available yet during the datagrid onAfterRender event: $(function(){ var onAfterRender = $.fn.datagrid.defaults.view.onAfterRender; $.extend($.fn.datagrid.defaults.view, { onAfterRender: function(target){ onAfterRender.call(this, target); GroupEdit.resize(target.id); } }); }); GroupEdit.resize() is being executed but there are not yet any columns in the datagrid. I must be missing something. Is there an easier way to resize the container? Thanks for any assistance. Gary Title: Re: Datagrid onAfterRender event finds no columns Post by: glarsen on August 01, 2014, 10:34:54 AM I noticed that the loadMsg 'Processing, please wait' is being displayed during onAfterRender. The table appears to be loaded but wondering if that is why the JQuery search is coming up empty.
Any suggestions? Thanks. Title: Re: Datagrid onAfterRender event finds no columns Post by: stworthy on August 01, 2014, 05:57:38 PM To get the element of header row, try the code below:
Code: var dg = $('#'+g); |