Ext.extend 与 Ext.define

SysPanel = function(config) {
    config = config || {};
    Ext.apply(config, {
        title:"Panel",
        width:100,
        height:100
    });
    SysPanel.superclass.constructor.call(this, config);
};

Ext.extend(SysPanel, Ext.form.Panel, {

});  


Ext.define('SysTreeStore', {
    extend: 'Ext.data.TreeStore',
    constructor: function (config) {
        var me = this;
        config = config || {};
        me.callParent([Ext.apply({
            storeId: 'MyTreeStore',
            fields: ["id", "text", "leaf", "expanded"],
            proxy:
            new Ext.data.HttpProxy
            (
                {
                    type: 'ajax',
                    url: cmdUrl,
                    extraParams: paramsTree
                }
            )
        }, config)]);
    }
});
      
posted @ 2012-11-28 16:00  CoolHu  阅读(2576)  评论(0编辑  收藏  举报