Results 1 to 3 of 3

Thread: HOW TO GET THE PARENT VALUE ON CLICK OF CHILD VALUE IN TREE GRID

  1. #1

    Default HOW TO GET THE PARENT VALUE ON CLICK OF CHILD VALUE IN TREE GRID

    How to get the value of 'VENDOR' and 'SLA' on click of 'MONTH' or 'VALUE'
    hot to get value of parent from the click of child value.
    Please do give me suggestion


    Here is my code....


    Ext.onReady(function () {
    Ext.define('Person', {
    extend: 'Ext.data.Model',
    fields: [
    { name: 'value', type: 'int',defaultValue :null },
    { name: 'year', type: 'string' },
    { name: 'sla', type: 'string' },
    { name: 'vendor', type: 'string' },
    ],
    });
    var store = Ext.create('Ext.data.TreeStore', {
    model: 'Person',
    root: {
    text: 'Root',
    expanded: true,
    children: [
    {
    sla: 'Effort',
    children: [
    {
    sla: 'Effort',
    vendor:'TCS',
    children: [
    {
    vendor:'TCS',
    year:'2013',
    value:'99',
    leaf: true
    },
    {
    vendor:'TCS',
    year:'2014',
    value:'100',
    leaf: true
    }
    ]
    },
    {
    sla: 'Effort',
    vendor:'HCL',
    children: [
    {
    vendor:'HCL',
    year:'2013',
    value:'99',
    leaf: true
    },
    {
    vendor:'HCL',
    year:'2014',
    value:'100',
    leaf: true
    }
    ]
    }
    ]

    },
    {
    sla: 'Variance',
    children: [
    {
    sla: 'Variance',
    vendor:'TCS',
    children: [
    {
    vendor:'TCS',
    year:'2013',
    value:'95',
    leaf: true
    },
    {
    vendor:'TCS',
    year:'2014',
    value:'100',
    leaf: true
    }
    ]
    },
    {
    sla: 'Variance',
    vendor:'HCL',

    year:'2014',
    value:'93',
    leaf: true

    }
    ]

    },
    ]
    }
    });
    Ext.create('Ext.tree.TreePanel', {
    renderTo: Ext.getBody(),
    width: 1000,
    height: 400,
    title: 'People',
    rootVisible:false,
    store: store,
    columns: [
    { xtype: 'treecolumn', header: 'SLA', dataIndex: 'sla', flex: 5 },
    { header: 'VENDOR', dataIndex: 'vendor', flex: 1 },
    { header: 'MONTH', dataIndex: 'year', flex: 1 },
    { header: 'VALUE', dataIndex: 'value', flex: 1 },

    ]
    });

    });
    Attached Images Attached Images

  2. #2
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Answers
    512
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  3. #3

    Default

    will this event return its parent record tooo..
    Please Suggest with an example if u can...

Posting Permissions

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