1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    23
    Answers
    1
    Vote Rating
    0
    shwetapro is on a distinguished road

      0  

    Default Answered: How to define multiple columns in TreePanel with dynamic data in first column

    Answered: How to define multiple columns in TreePanel with dynamic data in first column


    Hi,
    Initially I created a treepanel with (by default) single column, whose data needs to be manipulated from an array. This runtime manipulation was done through appendChild() method.

    The code goes here:

    var panel = Ext.create('PanelJS', {
    extend: 'Ext.tree.Panel',
    renderTo: Ext.getBody(),
    title: 'Plan Management',
    width: 300,
    height: 300,
    useArrows: true,
    singleExpand: true,
    root: {
    text: rootText
    }
    });

    var rootNode = panel.getRootNode();
    for(var i=0; i<planList.length; i++)
    {
    rootNode.appendChild({
    text: planList[i],
    id: someId,
    leaf: false
    });
    }

    When I created multiple columns(or used columns config) no data was getting visible in first column(dynamic data through appendChild() method).

    The code goes here:

    var panel = Ext.create('PanelJS', {
    extend: 'Ext.tree.Panel',
    renderTo: Ext.getBody(),
    title: 'Plan Management',
    width: 300,
    height: 300,
    store: store,
    fields: ['planName'],
    useArrows: true,
    singleExpand: true,
    root: {
    text: rootText
    },
    columns: [
    {
    xtype: 'treecolumn',
    text: 'Plan Name',
    // dataIndex: 'planName',
    flex: 1,
    renderer :function(value, meta)
    {
    alert("value = " + value);
    return value;
    }
    }
    ]
    });

  2. Hi,

    The problem got solved.
    I did a silly mistake .

    Instead of :
    rootNode.appendChild({
    text: planList[i],
    id: someId,
    leaf: false
    });

    It should be :
    rootNode.appendChild({
    planName: planList[i],
    id: someId,
    leaf: false
    });

    because the model I was using had planName as the field and I was setting the values in text config.


  3. #2
    Sencha User
    Join Date
    Apr 2012
    Posts
    23
    Answers
    1
    Vote Rating
    0
    shwetapro is on a distinguished road

      0  

    Default


    Hi,

    The problem got solved.
    I did a silly mistake .

    Instead of :
    rootNode.appendChild({
    text: planList[i],
    id: someId,
    leaf: false
    });

    It should be :
    rootNode.appendChild({
    planName: planList[i],
    id: someId,
    leaf: false
    });

    because the model I was using had planName as the field and I was setting the values in text config.


Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi