EasyUI Forum
May 03, 2024, 03:06:53 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: $.panel should have an "onRender" event  (Read 22431 times)
angers
Newbie
*
Posts: 11


View Profile Email
« on: January 23, 2013, 04:28:54 PM »

Panels and windows have no callback to indicate they have completed rendering. This is important when the developer does not want the user to see the panel before it has rendered.

Currently you have on "onLoad" event, but this is triggered by remote data calls...not by the html rendering.
Logged
Ellipsis
Full Member
***
Posts: 113


View Profile WWW
« Reply #1 on: January 24, 2013, 03:41:44 AM »

I agree, and this goes for almost all easyui components.
We use multiple components that control each others content, on initialization we had some work to get the flow right.

Event based solutions would have made things a lot better. 
Logged
angers
Newbie
*
Posts: 11


View Profile Email
« Reply #2 on: February 06, 2013, 11:58:58 PM »

Bump. Talk to us.
Logged
Ellipsis
Full Member
***
Posts: 113


View Profile WWW
« Reply #3 on: February 07, 2013, 11:14:17 AM »

Bump:

The documentation talks About onrender events for the view. The way this should be applied puzzles me....

At the moment I set flags, but the onRendered event should be available for the triggering new actions.

We are looking at different MV* possibillities, being Able to split Easyui components or events to models, views And controllers would be nice.
Logged
Ellipsis
Full Member
***
Posts: 113


View Profile WWW
« Reply #4 on: February 21, 2013, 03:25:56 AM »

How about the use of jQuery deferred?

See http://api.jquery.com/deferred.promise/ for an example.

The creation of a datagrid (or other easyui component) could return a deferred object.
Logged
Ellipsis
Full Member
***
Posts: 113


View Profile WWW
« Reply #5 on: March 07, 2013, 01:36:54 AM »

solved with the help of stworthy:

Code:

function generateDatagrid(strTargetId){

var obDfd = jQuery.Deferred(),
      obTarget = jQuery('#dg');

if(strTargetId) obTarget=jQuery(strTargetId);

obTarget.datagrid(....);

obTarget.datagrid({
view: jQuery.extend(true,{},$.fn.datagrid.defaults.view,{
onAfterRender: function(target){
$.fn.datagrid.defaults.view.onAfterRender.call(this,target);
obDfd.resolve()
}
})
});

return obDfd;

}

And the waiting side :

Code:
jQuery.when(generateDatagrid()).done(function(){

// datagrid is rendered, do something...

});

See : http://api.jquery.com/deferred.promise/
Logged
mhbu50
Newbie
*
Posts: 1


View Profile Email
« Reply #6 on: September 29, 2014, 05:30:36 AM »

Thanks Ellipsis for your post.

Could you explain the function generateDatagrid in more details or give live dome for that.

Regards
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!