Pop dialog outside of parent

Develop and Deploy Cross-Browser Web Apps .

Pop dialog outside of parent

Postby sedrok » Mon Jul 07, 2014 3:02 pm

Pop dialog outside of parent by creating new dialog

   
// The default code is a com class (inherited from xui.Com)
Class('App', 'xui.Com',{
// Ensure that all the value of "key/value pair" does not refer to external variables
Instance:{
// To initialize instance(e.g. properties)
initialize : function(){
// To determine whether or not the com will be destroyed, when the first UI control be destroyed
this.autoDestroy = true;
// To initialize properties
this.properties = {};
},
// To initialize internal components (mostly UI controls)
// *** If you're not a skilled, dont modify this function manually ***
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(30)
.setTop(10)
.setCaption("click me")
.onClick("_ctl_sbutton1_onclick")
);

append((new xui.UI.Panel())
.setHost(host,"ctl_panel3")
.setDock("none")
.setLeft(100)
.setTop(20)
.setWidth(680)
.setHeight(460)
.setZIndex(1)
.setCaption("ctl_panel3")
);

host.ctl_panel3.append((new xui.UI.Dialog())
.setHost(host,"ctl_dialog24")
.setLeft(71)
.setTop(61)
.setWidth(540)
.setShadow(false)
.setCaption("ctl_dialog1")
.setMovable(false)
.setMinBtn(false)
.setCloseBtn(false)
.beforePropertyChanged("_ctl_dialog1_beforepropertychanged")
);

host.ctl_dialog24.append((new xui.UI.RichEditor())
.setHost(host,"ctl_richeditor24")
.setDock("fill")
);

return children;
// ]]Code created by CrossUI RAD Tools
},
// Give a chance to load other com
iniExComs : function(com, threadid){
},
// Give a chance to determine which UI controls will be appended to parent container
customAppend : function(parent, subId, left, top){
// "return false" will cause all the internal UI controls will be added to the parent panel
return false;
},
// This instance's events
events : {"onRender":"_com_onrender"},
_ctl_sbutton1_onclick : function (profile, e, src, value) {
var uictrl = profile.boxing();
xui.alert("hi","I'm " + uictrl.getAlias());
},
_ctl_dialog1_beforepropertychanged:function (profile,name,value,ovalue){
var ns = this, uictrl = profile.boxing();
if(name=='dock') {
(new xui.UI.Dialog())
.setLeft(50)
.setTop(50)
.setWidth(1000)
.setHeight(600)
.setCloseBtn(true)
.setMaxBtn(true)
.setMinBtn(false)
.setCaption('title')
.setHtml('<div style="background-color:white">'+ns.ctl_richeditor24.getUIValue()+'</div>')
.onDestroy(function(){ window.$ns.ctl_dialog24.setStatus("normal"); })
.show();
return false;
}

},
_com_onrender:function (com,threadid){
var ns = this;
window.$ns = ns;
ns.ctl_richeditor24.setUIValue('<b>test</b>');
}
}
});
   
Attachments
24t223fg2423d.jpg
24t223fg2423d.jpg (53.13 KiB) Viewed 3513 times
sedrok
 
Posts: 26
Joined: Tue Jun 03, 2014 12:50 pm

Return to CrossUI for Web Apps

Who is online

Users browsing this forum: No registered users and 0 guests

cron