appframework icon indicating copy to clipboard operation
appframework copied to clipboard

$("#home").on('panelload', function() { alert("i'm start")}) when app first start is not works

Open muchengit opened this issue 9 years ago • 4 comments

afui3.0 $("#home").on('panelload', function() { alert("i'm start")}) when app first start is not works but other panel like $("#help").on('panelload', function() { alert("i'm help")}) is working can you tell me why? @imaffett

muchengit avatar Mar 16 '15 02:03 muchengit

Yes, default panel with active class, will has no event on app start! now ,I trigger it myself!

yg7001 avatar Apr 17 '15 14:04 yg7001

Can someone put a demo up replicating this?

imaffett avatar Apr 17 '15 14:04 imaffett

On AFUI 3, when you have a function that is to be executed once the app loads, do not use:

$("#home").on('panelload', function() { alert("i'm start")})

rather use the following: $.afui.ready(function(){alert("i'm start");});

Works perfectly.

placetrend avatar May 09 '15 22:05 placetrend

Did you figure this out? When are you adding the handler?

If you disable autolaunch, and setup the onLoad handler before you call $.afui.launch(), it the panelLoad should be triggered.

It might not be firing because the panel is loaded before you setup the onLoad event handler.

rvacca2 avatar Jun 04 '15 06:06 rvacca2