VAAA
VAAA

Reputation: 15049

ExtJS SenchaCMD MVC Override Folder - How to use it

I have my application build using Sencha CMD (ExtJS 4.2.1).

I generates a folder structure like the following image:

enter image description here

Now, I have a code that fixes a bug in the version 4.2.1 (when doing record.destroy() in a grid you get the error: Uncaught TypeError: Cannot read property 'className' of undefined )

Well, the point is how can I place this into the overrides folder and how to make it Extjs to consider it when building.

enter image description here

Ext.define('Ext.view.override.Table', {
    override: 'Ext.view.Table',
 
    doStripeRows: function(startRow, endRow) {
        var me = this,
            rows,
            rowsLn,
            i,
            row;
 
 
        if (me.rendered && me.stripeRows) {
            rows = me.getNodes(startRow, endRow);
 
            for (i = 0, rowsLn = rows.length; i < rowsLn; i++) {
                row = rows[i];
 
                if (row) { // self updating; check for row existence
                    row.className = row.className.replace(me.rowClsRe, ' ');
                    startRow++;
 
                    if (startRow % 2 === 0) {
                        row.className += (' ' + me.altRowCls);
                    }
                }
            }
        }
    }
 
});

Does the name 'Ext.view.override.Table' is ok or also I have to change that in order to let Sencha CMD to recognize it as an override?

Upvotes: 1

Views: 153

Answers (0)

Related Questions