EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
November 05, 2025, 01:51:14 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
Datagrid onAfterRender event finds no columns
Pages: [
1
]
« previous
next »
Print
Author
Topic: Datagrid onAfterRender event finds no columns (Read 11378 times)
glarsen
Newbie
Posts: 39
Datagrid onAfterRender event finds no columns
«
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
Logged
glarsen
Newbie
Posts: 39
Re: Datagrid onAfterRender event finds no columns
«
Reply #1 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.
Logged
stworthy
Administrator
Hero Member
Posts: 3581
Re: Datagrid onAfterRender event finds no columns
«
Reply #2 on:
August 01, 2014, 05:57:38 PM »
To get the element of header row, try the code below:
Code:
var dg = $('#'+g);
var cols = dg.datagrid('getPanel').find('.datagrid-header-row');
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...