Extjs practices: Ext. Tree. treepanel tree cannot be displayed

Source: Internet
Author: User

Ext. UX. Tree. columntree is used here. This is a treepanel extension class, which is included in the official package downloaded from extjs.

1.

Problem description: The Tree header is displayed normally, the data part is displayed normally in Firefox, and cannot be displayed in IE. (Such as the following code)

Cause resolution: the class cannot be used as the column name. There may be problems in IE. We recommend that you change it to another one, such as classname.

    var tree = new Ext.ux.tree.ColumnTree({           id: 'TreeGridId',        width: 1000,        height: "100%",        rootVisible:false,        autoScroll:true,        title: '  ',        renderTo: Ext.getBody(),        columns:[{            header:'Name',            width:180,            dataIndex:'name'        },{            header:'Class',            width:100,            dataIndex:'class'        },{            header:'Owner',            width:100,            dataIndex:'owner'        }],        loader: new Ext.tree.TreeLoader({            dataUrl:'jsdata.dat',            uiProviders:{                'col': Ext.ux.tree.ColumnNodeUI            }        }),               root: new Ext.tree.AsyncTreeNode({            text:'root'        })    });

The JSON data format is as follows:

[{name:'teste',class:'ClassName',owner:'testOwner',uiProvider:'col'},{name:'teste2',class:'ClassName2',owner:'testOwner2',uiProvider:'col'}]

2.

In addition, if the JSON data format is not standard, such as the absence of commas, it may also lead to normal Firefox and abnormal IE.

Conclusion: The tree data shows that Firefox is normal and IE is not normal. Generally, no error is reported. It is difficult to find the cause directly through the error console or debug tool, but it can be guessed that, the reason should be that the JSON data format is above. You can gradually find the reason from the display of a piece of data and a column.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.