Results 1 to 8 of 8

Thread: Extending Grid giving error with initConfig()

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Feb 2011
    Vote Rating

    Default Answered: Extending Grid giving error with initConfig()

    We need to extend the grid component and add new properties to it.

    Below is simplified version of the code we are using for it:

        extend: 'Ext.grid.Panel',
        alias: 'widget.pncgrid',
            showCountColumn:true//a new property added
            this.initConfig(config);//This line is throwing error -> me.additionalCls is undefined on ext-all-debug.js (line 17129)

    Here line this.initConfig(config); is producing the error - me.additionalCls is undefined ext-all-debug.js (line 17129).

    We have extended other components too, like window, textfield etc.. and used the same approach but have never faced this error.

    The error goes off as soon as the line this.initConfig(config) is commented. But if we comment this line then how will the new properties defined in config be initialized?

    Could someone guide at this?

    Thanks in advance.

  2. All the config object does is create the get and set methods so you don't have to use it.

    Ext.define('', {
        extend: 'Ext.grid.Panel',
        alias: 'widget.pncgrid',
        showCountColumn: true, //a new property added
        getShowCountColumn : function() {
            return this.showCountColumn;
        setShowCountColumn : function(value) {
            var me = this,
                oldValue = me.getShowCountColumn();
            if (me.applyShowCountColumn) {
                value = me.applyShowCountColumn(value, oldValue);
            if (!Ext.isDefined(value)) {
            this.showCountColumn = value;
            if (me.updateShowCountColumn) {
                this.updateShowCountColumn(value, oldValue);
    That would do the same thing just without calling initConfig and you get the get and set and the set method takes advantage of the apply and update methods just like initConfig does.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts