Sigma Php Ajax framework, Ajax Components, GUI Builder
May 24, 2012, 10:27:09 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
Sigma Php Ajax framework, Ajax Components, GUI Builder
>
Sigma Visual GUI Builder & Library
>
Sigma Visual - Q&A
(Moderators:
steven
,
linb
) >
how to use global function (function in app)
Pages: [
1
]
« previous
next »
Print
Author
Topic: how to use global function (function in app) (Read 335 times)
dekmai
Newbie
Posts: 1
how to use global function (function in app)
«
on:
September 07, 2011, 12:50:06 AM »
Hi there.
Please Check my code ,
1. i want to click button in App.ui
2. button in App.ui call static function sf1 in App. ( not work )
I test on Firefox 6 and IE9 (compatibility view)
My Code 1
Class('App', 'linb.Com',{ Instance:{ initialize : function(){ this.autoDestroy = true; this.properties = {}; }, Static:{ sf1:function(){ //alert('Global function'); SPA.T_input.setUIValue(' Test Value'); } }, iniComponents : function(){ var host=this, children=[], append=function(child){children.push(child.get(0))}; append( (new linb.UI.Input) .setHost(host,"T_input") .setLeft(220) .setTop(40) .setWidth(240) .setLabelSize(120) .setLabelCaption("Input") ); append( (new linb.UI.Block) .setHost(host,"ctl_block39") .setLeft(50) .setTop(120) .setWidth(520) .setHeight(340) ); return children; }, iniExComs : function(com, threadid){ }, customAppend : function(parent, subId, left, top){ return false; }, events : {"onReady":"_com_onready"}, _com_onready : function(com,threadid){ SPA = this; linb.ComFactory.newCom('App.ui',function(){ var ns = this; SPA.ctl_block39.append(ns.getUIComponents(),false); }); } } });
Code 2
Class('App.ui', 'linb.Com',{ Instance:{ initialize : function(){ this.autoDestroy = true; this.properties = {}; }, iniComponents : function(){ var host=this, children=[], append=function(child){children.push(child.get(0))}; append( (new linb.UI.SButton) .setHost(host,"ctl_sbutton1") .setLeft(130) .setTop(70) .setCaption("click me") .onClick("_ctl_sbutton1_onclick") ); return children; }, iniExComs : function(com, threadid){ }, customAppend : function(parent, subId, left, top){ return false; }, events : {}, _ctl_sbutton1_onclick : function (profile, e, src, value) { App.sf1(); // <------ Not Work } } });
Very many thanks
Dekmai
Logged
sedrok (jslinb.ru)
Sr. Member
Posts: 57
Re: how to use global function (function in app)
«
Reply #1 on:
September 30, 2011, 01:08:18 AM »
Static must be before instance
Class('App', 'linb.Com',{ Static:{ sf1:function(){ //alert('Global function'); SPA.T_input.setUIValue(' Test Value'); } }, Instance:{ iniComponents:function(){ // [[code created by jsLinb UI Builder var host=this, children=[], append=function(child){children.push(child.get(0))}; .......... .......................
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News & Announcements
-----------------------------
Sigma Visual GUI Builder & Library
-----------------------------
=> Sigma Visual - Knowledge Share
=> Sigma Visual - Q&A
=> Bug Report & Wishlist
-----------------------------
Sigma Grid
-----------------------------
=> Sigma Grid - Q&A
=> Show Case
=> Bug Report & Wishlist
-----------------------------
Other
-----------------------------
=> AJAX & JavaScript
Loading...