Results 1 to 3 of 3

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

  1. #1

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

    here is my js.

    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 },

    ]
    });

    });


    I am attaching my output.
    On click of any value of YEAR or VALUE
    I want to get its corresponding SLA Value.
    Kindly suggest me a solution.
    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

    but this is not returning the value i need.
    I should get the value of SLA.
    But its returning the values tht is there in the particular clicked row.

Posting Permissions

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