How to trigger event manually?

Find code here before you post.

How to trigger event manually?

Postby linb » Thu May 30, 2013 3:26 am

   
Class('App', 'xui.Com',{
Instance:{
iniComponents : function(){
// [[Code created by CrossUI RAD Tools
var host=this, children=[], append=function(child){children.push(child.get(0))};

append(
(new xui.UI.SButton)
.setHost(host,"ctl_sbutton1")
.setLeft(220)
.setTop(240)
.setCaption("Trigger beforePageClose Event only")
.onClick("_ctl_sbutton1_onclick")
);

append(
(new xui.UI.Pane)
.setHost(host,"ctl_pane6")
.setLeft(220)
.setTop(30)
.setWidth(370)
.setHeight(190)
);

host.ctl_pane6.append(
(new xui.UI.Tabs)
.setHost(host,"ctl_tabs2")
.setItems([{"id":"a", "caption":"item a", "image":"img/demo.gif"}, {"id":"b", "caption":"item b", "image":"img/demo.gif"}, {"id":"c", "caption":"item c", "image":"img/demo.gif"}, {"id":"d", "caption":"item d", "image":"img/demo.gif"}])
.setValue("a")
.beforePageClose("_ctl_tabs2_beforepageclose")
);

append(
(new xui.UI.SButton)
.setHost(host,"ctl_sbutton8")
.setLeft(470)
.setTop(240)
.setCaption("Trigger Dom Event")
.onClick("_ctl_sbutton8_onclick")
);

return children;
// ]]Code created by CrossUI RAD Tools
},
_ctl_sbutton1_onclick : function (profile, e, src, value) {
var tab=this.ctl_tabs2;
// Trigger
tab.beforePageClose(tab.get(0), tab.getItemByItemId('b'));
// Or
// tab.beforePageClose(tab.getItemByItemId('b'));
},
_ctl_tabs2_beforepageclose : function (profile, item, src) {
xui.pop(item.id);
},
_ctl_sbutton8_onclick : function (profile,e,src,value){
var tab=this.ctl_tabs2;
// Trigger
tab.getSubNode("ITEM","c").onMousedown(true);
}
}
});
   
linb
Site Admin
 
Posts: 102
Joined: Thu Apr 25, 2013 6:51 am

Return to CrossUI Code Snaps

Who is online

Users browsing this forum: No registered users and 3 guests

cron