Sencha,

Per the following ExtJS 5.0 Forum thread http://ift.tt/1mJlOaI, in Ext 5.0.0 given a tree model defined with field have both a convert and defaultValue defined, at runtime the convert function is only passed the default value. The secondary parameter (aka the record) is never passed to the convert method. Outlined below are the specific details of this defect.


thx,


@brady




Stand Alone Test Case:

Ext Version tested:




Browser version tested against:


  • Chrome (ver 35.0.1916.153)




Description:


As already mentioned (above), in Ext 5.0.0 given a tree model defined with a field having—

  • convert function

  • defaultValue equal


The signature of the of the convert method is corrupted so that consuming classes receive a undefined result. Per the http://ift.tt/1mJlOaK" defect template thread, outlined below are the specific details of this defect.

As explained, in the originating forum post (above), there is a work around. Specifically, do not define a “defaultValue” attribute on fields having a “convert” function. Although this approach resolves the problem, this configuration did work in the 4.2.2 release. Therefore this represents a defect from the standpoint of a user intending to upgrade a 4.2.2 application to 5.0.0. From the stand point of this user, the described work around (see thread link above) needs to be explicitly explained in the upgrade guide, or the new behavior needs to be addressed programmatically

Steps to reproduce the problem:



  1. Define a Tree model class having a field with the following config:

    • defaultValue equal to ‘?’

    • name equal to “text"

    • convert function which--

      • accepts a value parameter

      • accepts a record parameter

      • if the record parameter is defined then it returns the id property

        • otherwise, it returns the value parameter







  2. Define a tree store with a model set equal to the model class (1)

  3. Define a tree panel with the following config:

    • store property equal to the storeId of the tree store (2)

    • column collection containing a tree column with a dataIndex equal to the “text” field (1.2)



  4. Create an instance of the store (2)

  5. Create an instance of the tree panel (3)




The result that was expected:



Similar to 4.2.2, the tree panel should be rendered with the nodes displaying the converted "text" field value. In this case, each node should correspond to the id of the bound record.


The result that occurs instead:




In 5.0.0, the tree panel is rendered with all nodes displaying the default value defined on the "text" field. In this case, you are left with a tree of question marks.