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 楊軍威 閱讀(163) 評論(0)  編輯  收藏


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


          網站導航:
           

          導航

          統計

          常用鏈接

          留言簿

          隨筆檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 密山市| 台东市| 武清区| 固原市| 中山市| 清丰县| 芦溪县| 共和县| 广饶县| 永胜县| 芜湖市| 特克斯县| 新田县| 南投市| 南康市| 郁南县| 芦山县| 白水县| 库伦旗| 平邑县| 万年县| 霍邱县| 和龙市| 四子王旗| 富源县| 夏邑县| 安吉县| 邢台市| 雷山县| 桃园市| 富源县| 镇平县| 大关县| 丹东市| 玉溪市| 深泽县| 黑山县| 鲁山县| 舞钢市| 通城县| 孟州市|