1. #1
    Ext User
    Join Date
    Apr 2010
    Posts
    12
    Vote Rating
    0
    paul.laskar is on a distinguished road

      0  

    Default dynamically adding tabs from grid column on page load

    dynamically adding tabs from grid column on page load


    I want to add tabs from grid column on page load dynamically . Grid is pulling data in real time and every time page load it contains different set of data.

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    92
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Can you explain a bit more?

  3. #3
    Ext User
    Join Date
    Apr 2010
    Posts
    12
    Vote Rating
    0
    paul.laskar is on a distinguished road

      0  

    Default


    On page load I need to display a grid which will pull data from a real time data base . I am using json store for it and used jsp to convert into json objects . I am getting the data in my grid but I need to dynamically add tabs from the first column of that grid .
    My loop for dynamically adding tabs is not working . I tried to test with an alert and its working great and looping through all the data from first colum but when I am trying tabPanel.add its not working. If you need more information please let me know . I can post the snippets of my code if you want.

    Thanks!

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    92
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    You need to call doLayout() after adding all tabitems.

  5. #5
    Ext User
    Join Date
    Apr 2010
    Posts
    12
    Vote Rating
    0
    paul.laskar is on a distinguished road

      0  

    Default


    Thanks! I got the dynamic tabs . I am missing title:columnName.toString() and doLayout ofcourse.....
    Code:
    store.on('load', function(){
                 store.each(function(rec)
                 {
                    var column1 = rec.get('COLUMN!');
                    //alert(tieback);
                    tabPanel.add({title:column1.toString()},
                                
                    tabPanel.doLayout();
                 });
             });

  6. #6
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    92
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    You only have to call doLayout once, so you should move it out of the each() loop.

  7. #7
    Ext User
    Join Date
    Apr 2010
    Posts
    12
    Vote Rating
    0
    paul.laskar is on a distinguished road

      0  

    Default


    thanks! this is solved...you can close this thread...but this is still working if I don't move it out of the loop..

Similar Threads

  1. Dynamically add tabs from grid column on page load
    By paul.laskar in forum Sencha Touch 1.x: Discussion
    Replies: 4
    Last Post: 23 Jul 2010, 3:02 PM
  2. Adding tabs dynamically
    By poppabear in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 26 Mar 2009, 4:55 PM
  3. Grid column with renderer is blank on page load
    By karrelsj in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 19 Mar 2009, 9:14 AM
  4. dynamically adding a new column on grid
    By asmishra in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 2 Apr 2008, 8:33 AM
  5. Adding dynamically a column to a grid
    By Gualterio in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 5 Mar 2008, 9:23 AM

Thread Participants: 1

Tags for this Thread