Results 1 to 2 of 2

Thread: Notes on upgrade from Ext3.3 to Ext4.1

  1. #1
    Sencha Premium Member
    Join Date
    Dec 2007
    Vote Rating

    Default Notes on upgrade from Ext3.3 to Ext4.1

    Here are various notes I've collected on upgrading our application from Ext3.3 to Ext4.1. The application is about 60,000 lines of javascript. I first tried using the compatibility layer but our application did not work without removing a lot of the code. I therefore gave up on the compatibility layer and proceeded straight to porting directly to Ext4.1. I found it easiest to get our app working with our basic infrastructure and then slowly added code back a module at a time.

    Common errors:
    • Cannot call method 'substring' of undefined
      An invalid xtype
    • Object true has no method 'setUI'
    • Object true has no method 'hide'
    • Cannot read property 'dom' of null
      Header attribute on a Panel is true. Remove it. Header is now a component not a boolean.
    • Cannot read property 'model' of undefined
      Store's reader is invalid
    • Cannot read property 'items' of undefined
    • Cannot call method 'insert' of undefined
      Ensure initComponent function calls this.callParent
    • Cannot call method 'apply' of undefined
      Ensure event listener method is correct when calling "on"
    • Cannot use 'in' operator to search for 'width' in undefined
      GridPanel columns property is wrong. "columns: ['name']" should be "columns: [ {dataIndex: 'name'

    • Element.down and Element.child functions have switched
    • Field width now includes the label width
    • Ext.form.Basic now has dirtychange and validitychange events, not a clientvalidation event.
    • Checkbox no longer has check event. Use change event.
    • autoheight and autowidth no longer exist.\u221e
    • Use iconCls instead of cls for Action config objects. Remove x-btn-text-icon.
    • sortInfo property for Stores is now called sorters. Example, sorters: { property: 'name' }
    • FieldSet is no longer a Panel
    • Column renderer "css" has changed to "tdCls" as a parameter of the metadata argument in the renderer function
    • Do not use "data" property of a record to get an attribute. You must now use the get function.
    • Function.createDelegate is now Ext.bind
    • Date.format is now Ext.Date.format

    • select event passes an array of records, not a single record
    • triggerAction default is now 'all'
    • mode config parameter renamed to queryMode.

    • Additional trigger icons are created by adding additional trigger classes. For example, to create a twin trigger field, add the two class properties: 'trigger1Cls : <clsid>' and 'trigger2Cls : <clsid2>' to the trigger field. You should then handle onTrigger1Click and onTrigger2Click.
    • triggerClass is now triggerCls or trigger1Cls

    • The event 'rowdblclick' does not appear to be supported even though it is in the 4.x docs. Use itemdbclick
    • Default selection mode is now single select. Set multiSelect to true in the grid's config for multiselection.
    • No more 'autoExpandColumn' property. Instead specify "flex: 1" on the column definition.

    • Always use node.getId(), not
    • Use node.get(key) to get a node's custom property. Not node.attributes.key.

    • No longer has getSelected(). Only has getSelection()

    • this.callParent() is like using the apply function. It requires its arguments to be in an array.
    • Do not call doLayout(). If you are adding/removing a bunch of components surround the code with Ext.suspendLayouts() and Ext.resumeLayouts(true).

    Writing custom fields:
    • For a container, extend from Ext.form.FieldContainer
      Make sure to use the Ext.form.field.Field mixin.
      Remember to call initField() in initComponent()
      Set isFormField to false for child components. This prevents Ext.form.Basic from returning the child component's value when calling form.getValues(). In our case, we have FieldContainers which should return a single value.
    • Use "margin" instead of "style: margin"
    • Override valueToRaw() function to convert a value into a user presentable (ie. raw) value
    • Call checkChange() after updating the value in a custom setValue() function

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    Thanks for providing this for others to see.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:

Posting Permissions

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