@@ -1555,20 +1555,20 @@ xui.merge(xui,{
15551555 // get : crossdomain => JSONP, else Ajax
15561556 : xui.absIO.isCrossDomain(uri) ? xui.JSONP : xui.Ajax;
15571557 },
1558- request:function(uri, query, onSuccess, onFail, threadid, options){
1559- return xui._getrpc(uri, query, options).apply(null , arguments).start();
1558+ request:function(uri, query, onSuccess, onFail, threadid, options, t ){
1559+ return (t= xui._getrpc(uri, query, options)) .apply(t , arguments).start();
15601560 },
15611561 ajax:function(uri, query, onSuccess, onFail, threadid, options){
1562- return xui.Ajax.apply(null , arguments).start();
1562+ return xui.Ajax.apply(xui.Ajax , arguments).start();
15631563 },
15641564 jsonp:function(uri, query, onSuccess, onFail, threadid, options){
1565- return xui.JSONP.apply(null , arguments).start();
1565+ return xui.JSONP.apply(xui.JSONP , arguments).start();
15661566 },
15671567 xdmi:function(uri, query, onSuccess, onFail, threadid, options){
1568- return xui.XDMI.apply(null , arguments).start();
1568+ return xui.XDMI.apply(xui.XDMI , arguments).start();
15691569 },
15701570 fetch:function(uri, query, onSuccess, onFail, threadid, options){
1571- return xui.Fetch.apply(null , arguments).start();
1571+ return xui.Fetch.apply(xui.Fetch , arguments).start();
15721572 },
15731573 restGet:function(uri, query, onSuccess, onFail, threadid,options){
15741574 if(!options) options={};options.method="get";
@@ -2017,6 +2017,7 @@ xui.merge(xui,{
20172017 do{p=pool[i++]}while(i<l && (p&&p.firstChild))
20182018 if(!p || p.firstChild){
20192019 p=document.createElement('div');
2020+ p.style.display = 'none';
20202021 p.id=xui._ghostDivId;
20212022 pool.push(p);
20222023 }
@@ -2783,6 +2784,8 @@ new function(){
27832784 if(target.charAt(0)=='{' && (t = xui.adjustVar(target, _ns))){
27842785 if(xui.isFun(t.getRef))ref=t.getRef();
27852786 if(xui.isFun(t.getAlias))alias=t.getAlias();
2787+ }else{
2788+ alias = target;
27862789 }
27872790 if(alias || ref){
27882791 if(method=="disable"||method=="enable"){
@@ -3677,7 +3680,7 @@ xui.Class('xui.absIO',null,{
36773680 data : options.data||options.body||'',
36783681 contentType : options.contentType||'',
36793682 Accept : options.Accept||'',
3680- headers : options.headers||options.header||null ,
3683+ headers : xui.merge(me.global_header||{}, options.headers||options.header||{}, 'all') ,
36813684 asy : options.asy!==false,
36823685 scriptType: options.scriptType
36833686 },'all');
@@ -3740,20 +3743,23 @@ xui.Class('xui.absIO',null,{
37403743 xui.Thread.resume(self.threadid);
37413744 xui.tryF(self.$onEnd,[],self);
37423745 xui.tryF(self.onEnd,[],self);
3746+ xui.tryF(self.constructor.onEnd,[],self);
37433747 self._clear();
37443748 }
37453749 },
37463750 _onStart:function(){
37473751 var self=this;
37483752 self._status = "started";
37493753 xui.Thread.suspend(self.threadid);
3754+ xui.tryF(self.constructor.onStart,[],self);
37503755 xui.tryF(self.$onStart,[],self);
37513756 xui.tryF(self.onStart,[],self);
37523757 },
37533758 _onResponse:function(){
3754- var self=this;
3755- if(false!==xui.tryF(self.beforeSuccess,[self._response, self.rspType, self.threadid], self))
3756- xui.tryF(self.onSuccess,[self._response, self.rspType, self.threadid], self);
3759+ var self=this,a=[self._response, self.rspType, self.threadid];
3760+ if(false!==xui.tryF(self.constructor.beforeSuccess,a, self))
3761+ if(false!==xui.tryF(self.beforeSuccess,a, self))
3762+ xui.tryF(self.onSuccess,a, self);
37573763 self._onEnd();
37583764 },
37593765 _handleTimeout:function(){
@@ -3778,9 +3784,10 @@ xui.Class('xui.absIO',null,{
37783784 self._flag = xui.asyRun(tryTimeout, self.timeout);
37793785 },
37803786 _onError:function(e, status, statusText, response){
3781- var self=this;
3782- if(false!==xui.tryF(self.beforeFail,[e, self.threadid, status, statusText, response],self))
3783- xui.tryF(self.onFail,[e, self.rspType, self.threadid, status, statusText, response], self);
3787+ var self=this, a = [e, self.rspType, self.threadid, status, statusText, response];
3788+ if(false!==xui.tryF(self.constructor.beforeFail,a,self))
3789+ if(false!==xui.tryF(self.beforeFail, a ,self))
3790+ xui.tryF(self.onFail, a, self);
37843791 self._onEnd();
37853792 },
37863793 getStatus:function(){
@@ -3903,7 +3910,7 @@ xui.Class('xui.Fetch','xui.absIO',{
39033910 if(!xui.isEmpty(self.data)){
39043911 if(self.reqType=="json"){
39053912 self.body = JSON.stringify(self.data);
3906- xui.set(self,['headers','Content-type', '" application/json']);
3913+ xui.set(self,['headers','Content-type', 'application/json']);
39073914 }
39083915 // others form data
39093916 else{
@@ -73936,7 +73943,8 @@ xui.Class("xui.svg.group", "xui.svg.absComb",{
7393673943 }
7393773944 layoutData.cells = cells;
7393873945 prf.properties.layoutData = layoutData;
73939- prf.box._rerender(prf, true);
73946+ if(prf.renderId)
73947+ prf.box._rerender(prf, true);
7394073948 });
7394173949 }
7394273950 },
@@ -74285,13 +74293,15 @@ xui.Class("xui.svg.group", "xui.svg.absComb",{
7428574293 // remove embedded ui
7428674294 if(prf.children){
7428774295 xui.arr.each(prf.children,function(v){
74288- v[0].destroy();
74296+ v[0].boxing(). destroy();
7428974297 });
7429074298 }
7429174299 // must purge lazy-bound node here
7429274300 var t, node=prf.getSubNode("BOX").get(0);
74293- if(node)
74301+ if(node){
7429474302 xui.$purgeChildren(node);
74303+ prf.clearCache();
74304+ }
7429574305
7429674306 // for design mode
7429774307 if(t=prf.$htable){
@@ -74496,11 +74506,7 @@ xui.Class("xui.svg.group", "xui.svg.absComb",{
7449674506 +'>' + ins.getCaption();
7449774507 }else{
7449874508 data.value = ins.getShowValue?ins.getShowValue():
74499- ins.getValue?('$UIvalue' in childPrf.properties?ins.getUIValue():ins.getValue()):
74500- ins.getCaption?ins.getCaption():
74501- ins.getHtml?ins.getHtml():
74502- ins.getLabel?ins.getLabel():
74503- '';
74509+ ins.getValue?('$UIvalue' in childPrf.properties?ins.getUIValue():ins.getValue()):'';
7450474510 }
7450574511 }
7450674512 }
@@ -75083,7 +75089,7 @@ xui.Class("xui.svg.group", "xui.svg.absComb",{
7508375089 for(var col=0,n=colSize;col<n;col++){
7508475090 var chr = xui.ExcelFormula.toColumnChr(col+1);
7508575091 if(t = xui.get(layoutData, ['colSetting', chr,'width'])){
75086- fix += parseInt(t, 10)|| 0;
75092+ fix += parseInt(t, 10) || 0;
7508775093 reCalculated.push(t);
7508875094 }else{
7508975095 count++;
@@ -75221,6 +75227,7 @@ xui.Class("xui.svg.group", "xui.svg.absComb",{
7522175227 t.updateSettings(opt);
7522275228 },
7522375229 $beforeAppend:function(prf,target,subId){
75230+ /*
7522475231 if(!subId)return false;
7522575232 // only one allowed
7522675233 if(target.size()==1){
@@ -75230,6 +75237,7 @@ xui.Class("xui.svg.group", "xui.svg.absComb",{
7523075237 }
7523175238 }, true);
7523275239 }
75240+ */
7523375241 },
7523475242 $afterAppend:function(prf, target,subId){
7523575243 if(!subId)return;
@@ -75240,24 +75248,25 @@ xui.Class("xui.svg.group", "xui.svg.absComb",{
7524075248 var cell = prf.getSubNode("TD", item._serialId),
7524175249 isFormField = inputPrf.box._isFormField ? inputPrf.box._isFormField(inputPrf) : !!xui.get(inputPrf,['properties','isFormField']),
7524275250 mode = prf.boxing().getMode(),
75243- show = mode!='read' || target['xui.UI.RichEditor'];
75251+ show = mode!='read' || target['xui.UI.RichEditor'] || !isFormField ;
7524475252 if(isFormField && (!iProp.name || prf.ItemIdMapSubSerialId[iProp.name])){
7524575253 iProp.name = item.id;
7524675254 }
75247- // for form field only
7524875255 // onsize for dom must here
7524975256 if(cell && cell.get(0)){
7525075257 // if parent is re-rendered
7525175258 if(inputPrf._cellresizeP!=cell){
75252- var adjustSize = function(){
75253- if(!cell.get(0))return;
75254- target.setPosition('absolute').setLeft(0).setTop(0);
75255- // first row/col , 2 pix border
75256- if(target.setWidth)target.setWidth(cell.offsetWidth()-(item.col?1:2));
75257- if(target.setHeight)target.setHeight(cell.offsetHeight()-(item.row?1:2));
75258- };
75259- adjustSize();
75260- cell.onSize(adjustSize,'cellresize');
75259+ if(!iProp.tagVar._autonomy){
75260+ var adjustSize = function(){
75261+ if(!cell.get(0))return;
75262+ target.setPosition('absolute').setLeft(0).setTop(0);
75263+ // first row/col , 2 pix border
75264+ if(target.setWidth)target.setWidth(cell.offsetWidth()-(item.col?1:2));
75265+ if(target.setHeight)target.setHeight(cell.offsetHeight()-(item.row?1:2));
75266+ };
75267+ adjustSize();
75268+ cell.onSize(adjustSize,'cellresize');
75269+ }
7526175270 inputPrf._cellresizeP=cell;
7526275271 }
7526375272 }
@@ -75267,49 +75276,47 @@ xui.Class("xui.svg.group", "xui.svg.absComb",{
7526775276 inputPrf._attached2cell = 1;
7526875277 // for form field only
7526975278 // prop and autoexpand
75270- if(isFormField){
75271- if(show){
75272- inputPrf.locked = 1;
75273- inputPrf.boxing().setDisplay('');
75274- if(target.setLabelPos) target.setLabelPos('none').setLabelCaption('').setLabelSize('0');
75275- if(target.setVAlign) target.setVAlign('middle');
75276-
75277- if(target['xui.UI.Input']
75278- && target.getMultiLines && target.getMultiLines()
75279- && target.setAutoexpand
75280- ){
75281- // use the hidden one: _autoexpand
75282- // once: set minH from subId
75283- if(!parseFloat(inputPrf._autoexpand)){
75284- // need set autoexpand in afterRowResize too
75285- inputPrf._autoexpand = (cell.offsetHeight()-1)+"px";
75286- inputPrf.getSubNode("INPUT").addClass("autoexpand");
75287- inputPrf.$beforeAutoexpand=function(p,h){
75288- h=target.getAutoexpandHeight();
75289- item._child_autoexpandH = h;
75290- if(prf.boxing()._isDesignMode()){
75291- // ensure to trigger table render once
75292- xui.resetRun(prf.getUid("autoex"), function(){
75293- if(prf.$htable)prf.$htable.render();
75294- });
75295- }else{
75296- cell.height(h);
75297- }
75298- // adjust custom borders
75299- if(!prf.boxing()._isDesignMode())
75300- prf.box._setCustomBorders(prf);
75301- return false;
75302- };
75303- // try to trigger aoutoexpand
75304- inputPrf.box._checkAutoexpand(inputPrf);
75305- }
75306- }
75307- if(mode=='read'){
75308- if(target.setReadonly)target.setReadonly(true,true);
75279+ if(show){
75280+ inputPrf.locked = 1;
75281+ inputPrf.boxing().setDisplay('');
75282+ if(target.setLabelPos) target.setLabelPos('none').setLabelCaption('').setLabelSize('0');
75283+ if(target.setVAlign) target.setVAlign('middle');
75284+
75285+ if(target['xui.UI.Input']
75286+ && target.getMultiLines && target.getMultiLines()
75287+ && target.setAutoexpand
75288+ ){
75289+ // use the hidden one: _autoexpand
75290+ // once: set minH from subId
75291+ if(!parseFloat(inputPrf._autoexpand)){
75292+ // need set autoexpand in afterRowResize too
75293+ inputPrf._autoexpand = (cell.offsetHeight()-1)+"px";
75294+ inputPrf.getSubNode("INPUT").addClass("autoexpand");
75295+ inputPrf.$beforeAutoexpand=function(p,h){
75296+ h=target.getAutoexpandHeight();
75297+ item._child_autoexpandH = h;
75298+ if(prf.boxing()._isDesignMode()){
75299+ // ensure to trigger table render once
75300+ xui.resetRun(prf.getUid("autoex"), function(){
75301+ if(prf.$htable)prf.$htable.render();
75302+ });
75303+ }else{
75304+ cell.height(h);
75305+ }
75306+ // adjust custom borders
75307+ if(!prf.boxing()._isDesignMode())
75308+ prf.box._setCustomBorders(prf);
75309+ return false;
75310+ };
75311+ // try to trigger aoutoexpand
75312+ inputPrf.box._checkAutoexpand(inputPrf);
7530975313 }
75310- }else{
75311- inputPrf.boxing().setDisplay('none');
7531275314 }
75315+ if(mode=='read'){
75316+ if(target.setReadonly)target.setReadonly(true,true);
75317+ }
75318+ }else{
75319+ inputPrf.boxing().setDisplay('none');
7531375320 }
7531475321 inputPrf.$handleCustomVars=function(d){
7531575322 if(d){
0 commit comments