java學習

          java學習

           

          Extjs解密1

          /**
          * Created by Administrator on 2017/3/24.
          */

          var extend=function (c,f) {
          c.prototype=f.prototype;
          }
          var f=function () {
          this.a='aa';

          }
          f.prototype={
          say:function () {
          alert('f');
          }
          }
          var c=function () {
          this.b='aa';
          }
          extend(c,f);//只能繼承prototype實現的方法
          var c1=new c();
          c1.say();


          Ext.namespace('com.ext');
          com.ext.First=function () {
          var kiss='中國';

          }
          com.ext.First.prototype={
          init:function () {
          alert('init');
          alert('kiss');
          },
          method:function () {
          alert('method');
          }
          }
          //var f=new com.ext.First();
          //f.method();
          com.ext.Second=function () {

          }
          Ext.extend(com.ext.Second,com.ext.First,{

          method:function () {
          alert('method2');
          },
          fun:function () {
          alert('fun');
          }
          });
          var s=new com.ext.Second();
          s.method();
          s.fun();
          Student=function (config) {
          this.a='3';
          Ext.apply(this,config);
          }
          var st=new Student({a:'1',b:'2'});
          alert(st.a);

          Student1=function (config) {
          this.a='3';
          Ext.applyIf(this,config);
          }
          var st=new Student1({a:'1',b:'2'});
          alert(st.a);
          /**apply方法覆蓋所有的屬性
          * applyIf不覆蓋屬性
          *
          */



          posted on 2017-03-24 17:52 楊軍威 閱讀(164) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           

          導航

          統計

          常用鏈接

          留言簿

          隨筆檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 方山县| 湖州市| 西林县| 延川县| 迁西县| 阆中市| 奉新县| 郧西县| 凤台县| 阳信县| 遵义县| 仁怀市| 白银市| 昌图县| 兰西县| 辽源市| 阳高县| 北票市| 达日县| 金沙县| 水富县| 建阳市| 肇东市| 安塞县| 青岛市| 孝义市| 渑池县| 含山县| 金塔县| 四平市| 衡阳市| 富宁县| 青冈县| 定南县| 德钦县| 西宁市| 奇台县| 德令哈市| 兰溪市| 定南县| 信阳市|