ExtJS精華函式解析 僅個人見解

2021-08-29 19:30:04 字數 2211 閱讀 3920

ext.extend(sb, sp, overrides)即sb擴充套件sp的所有物件,overriders即你想增加的物件或者方法.可以覆蓋sp的物件也與方法及屬性.

這是本人從ext中扣出來的精華部分,大家完全可以根據這個精華自己去寫擴充套件,寫框架. /**

* author:sloppy

* date:2007-09-15

*/if(typeof(ext)=="undefined");

}window["undefined"] = window["undefined"];

if(defaults)

if(o && c && typeof c == 'object')

}return o;

};(function()catch(e){}

}emptyfn : function(){},

if(o && c)}}

return o;

},extend : function()

};return function(sb, sp, overrides)

var f = function(){}, sbp, spp = sp.prototype;

f.prototype = spp;

sbp = sb.prototype = new f();

sbp.constructor=sb;

sb.superclass=spp;

if(spp.constructor == object.prototype.constructor)

sb.override = function(o);

sbp.override = io;

ext.override(sb, overrides);

return sb;

};}(),

override : function(origclass, overrides)}},

namespace : function();} o = ' + rt + ';');

for (j=1; j

o[d[j]]=o[d[j]] || {};

o=o[d[j]];}}

},urlencode : function(o)

var buf = ;

for(var key in o)else if(type != "function" && type != "object")else if(ov instanceof array)

} else }}

buf.pop();

return buf.join("");

},urldecode : function(string, overwrite);

}var obj = {};

var pairs = string.split('&');

var pair, name, value;

for(var i = 0, len = pairs.length; i < len; i++)else if(typeof obj[name] == "string")else

}else

}return obj;

},isie : isie,

isie7 : isie7,

isgecko : isgecko,

isstrict:isstrict

});})();

escape : function(string) ,

/**var s = string.leftpad('123', 5, '0');

// s now contains the string: '00123'

*/leftpad : function (val, size, ch)

while (result.length < size)

return result;

},/**

var cls = 'my-class', text = 'some text';

var s = string.format('

', cls, text);

// s now contains the string: 'some text'*/

format : function(format)/g, function(m, i));

}});

indexof : function(o)

return -1;

},remove : function(o)

}});

Extjs常用函式介紹

extjs常用函式介紹 ext.util.format類 ext.util.format.capitalize teststr 將首字串的第乙個字母大寫!ext.util.format.ellipsis teststr,9 那麼就將字串擷取總長度為9,但最後三個字元卻要用.表示 ext.util.f...

ExtJs動畫函式詳解

老樣子,啥也不說了,貼 你們懂的。cartoonext.php 效果列表 easenone easein easeout easeboth easeinstrong easeoutstrong easebothstrong elasticin elasticout elasticboth backi...

關於虛函式的精華討論

以下是我從網路上摘錄下來的,感覺看完這些精華討論估計對虛函式和純虛函式也理解差不多了。1.虛函式 參考書籍 com本質論 侯捷老師的 深入淺出mfc 疑問1 若是為了繼承,那麼普通的類 沒有虛函式,純虛函式 就可以被繼承,而且工作的相當好.虛函式倒是可以理解,應該是可以通過,乙個指向基類物件的指標能...