Results 1 to 5 of 5

Thread: Need to change DOM structure of ExtJS 4.2 tree??

  1. #1
    Sencha User
    Join Date
    Jan 2014
    Posts
    11
    Vote Rating
    0
      0  

    Default Need to change DOM structure of ExtJS 4.2 tree??

    I want to add some ARIA-Attributes like role(as treeitem and group) and aria-level into TREE DOM.Could any one please help on this??
    and
    I want to add all child leaves in one <ui> list. and i need to set role as group then Screen reader can detect that group and read it correctly?

  2. #2
    Sencha User palakurthivishal's Avatar
    Join Date
    Jul 2013
    Location
    India
    Posts
    74
    Answers
    8
    Vote Rating
    5
      0  

    Default

    Hello muralisk477,
    Try this snippet, I guess this suits your requirements.
    Code:
    var store = Ext.create('Ext.data.TreeStore', {    root: {
            expanded: true,
            children: [
                { text: "detention", leaf: true },
                { text: "homework", expanded: true, children: [
                    { text: "book report", leaf: true },
                    { text: "algebra", leaf: true}
                ] },
                { text: "buy lottery tickets", leaf: true }
            ]
        }
    });
    
    
    Ext.create('Ext.tree.Panel', {
        title: 'Simple Tree',
        width: 200,
        height: 150,
        store: store,
        rootVisible: false,
        renderTo: Ext.getBody(),
        renderer : function(){debugger;},
        listeners : {
            afterrender : function(cmp){
                var dom = cmp.getEl().dom;
                var leaves = dom.getElementsByClassName('x-grid-tree-node-leaf'); // this class gets applied to leaves 
                Ext.each(leaves, function(leaf){
    // add whatever attributes here
                    leaf.setAttribute('data-aria',123);
                })
            }
        }
    });

  3. #3
    Sencha User
    Join Date
    Jan 2014
    Posts
    11
    Vote Rating
    0
      0  

    Default

    Thanks Vishal for your response...

  4. #4
    Sencha User palakurthivishal's Avatar
    Join Date
    Jul 2013
    Location
    India
    Posts
    74
    Answers
    8
    Vote Rating
    5
      0  

    Default

    No problem, I just wan't to ask you whether that was the exact solution you needed?

  5. #5
    Sencha User
    Join Date
    Jan 2014
    Posts
    11
    Vote Rating
    0
      0  

    Default

    Actually, I was out of station from last week, let me check and i ll get back to you vishal,ThanksMurali S

Posting Permissions

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