View Full Version : [CLOSED] [4.2.1 beta] TreePanel's fields ignore mapping

6 May 2013, 3:16 AM

Ext version tested:

Ext 4.2.1 beta

Browser versions tested against:


DOCTYPE tested against:

<!DOCTYPE html>


A TreePanel's fields ignore mapping.

Steps to reproduce the problem:

Click the Buttom

The result that was expected:

"Hello!" in the alert box

The result that occurs instead:

Nothing in the alert box

Test Case:

<!DOCTYPE html>
<title>TreePanel's fields ignore mapping</title>

<link rel="stylesheet" href="../resources/css/ext-all.css" />

<script src="../ext-all-debug.js"></script>

Ext.onReady(function () {
var tree = Ext.create("Ext.tree.Panel", {
renderTo: Ext.getBody(),
fields: [{
name: "text"
}, {
name: "someFieldName",
mapping: "test"
root: {
leaf: true,
text: "Root",
test: "Hello!"
Ext.create("Ext.button.Button", {
renderTo: Ext.getBody(),
handler: function () {
text: "Get"

6 May 2013, 5:03 AM
Typically fields are only run through the reader if it's loaded remotely. You'd see the same behaviour with a grid. A mapping is only really required if you're reading it directly from the server. If you're able to do it locally, it means you've got control of the format.

6 May 2013, 8:38 PM
Thank you for the answer, Evan.

It looks a real scenario to load some nodes from a server bypasing a TreeStore and add those nodes by, for example, an appendChild call, and expect that mapping will be taken into account.

Also it looks inconsistent that a convert function executes in such a scenario, but mapping is not.

It would be also nice to see a pair of words about it here.

What do you think?