Steps to overriding Sencha ExtJS standard component functionality (Ext.tree.Panel & Ext.data.TreeStore as two examples)

后端 未结 2 1615
孤城傲影
孤城傲影 2020-12-24 03:44

Suppose I am extending a standard Sencha ExtJS 4 widget/component, and I found a bunch of things that don\'t work the way I want them to, or perhaps they are just broken and

2条回答
  •  生来不讨喜
    2020-12-24 04:33

    Override the functions which you think are not working correctly or the way you want it to work

    Example

    Ext.define('MyApp.store.TreeGridStore', {
    extend: 'Ext.data.TreeStore',
    getTotalCount : function() {
        if(!this.proxy.reader.rawData) return 0;
        this.totalCount = this.proxy.reader.rawData.recordCount;
        return this.totalCount;
    },  
    ....
    

    In the above example I want the getTotalCount function to calculate the count differently, so I extended the treestore and overrided the method.

提交回复
热议问题