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
// 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())
.setCaption("click me")

append((new xui.UI.Panel())

host.ctl_panel3.append((new xui.UI.Dialog())

host.ctl_dialog24.append((new xui.UI.RichEditor())

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())
.setHtml('<div style="background-color:white">'+ns.ctl_richeditor24.getUIValue()+'</div>')
.onDestroy(function(){ window.$ns.ctl_dialog24.setStatus("normal"); })
return false;

_com_onrender:function (com,threadid){
var ns = this;
window.$ns = ns;
24t223fg2423d.jpg (53.13 KiB) Viewed 3513 times
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