GridPanel links opening in a tab which is created at runtime

  1. #1

    GridPanel links opening in a tab which is created at runtime



    Hi


    I am in a situation, where I have links appearing in Grid rows, now whenever a link is clicked it should add a tab to already existing tabpanel and open that "offers.aspx?id=" in that new tab.

    <script type="text/javascript">    
    var linkRenderer = function(value, meta, record) {
    return String.format('<a href="offers.aspx?id={0}">{1}</a>', record.data.id, record.data.company);
    }
    </script>

    I am already doing same thing on a click event of a tree node.. but need to do on cell click of grid.


    The only problem that I am facing is that I am unable to pass the reference of the tabPanel as argument for grid.


    following is an example of what I am thinking..


    var loadTab = function(tabPanel, record)  // I have tried passing record.. but it says it does not exist.. please HELP.
    {
    var tab = tabPanel.getItem(record.data.id);
    if (!tab) {
    tab = tabPanel.add({
    id: record.data.id,
    title: record.data.company,
    closable: true,
    autoLoad: {
    showMask: true,
    url: "offers.aspx?id={0}, //Here I  would be providing link to the page.. something like that.. 
    mode: 'iframe',
    maskMsg: 'Loading ' + record.data.company + '...'
    },
    listeners: {
    update: {
    fn: function(tab, cfg) {
    cfg.iframe.setHeight(cfg.iframe.getSize().height - 20); 
    },
    scope: this,
    single: true
    }
    }
    }); 
    }
    tabPanel.setActiveTab(tab);
    }
  2. #2

    RE: GridPanel links opening in a tab which is created at runtime

    Vlad / Geoff

    please reply on this.

    Thanks &amp; Regards

Similar Threads

  1. Replies: 1
    Last Post: May 09, 2012, 7:08 PM
  2. Replies: 6
    Last Post: Apr 03, 2012, 1:54 PM
  3. [CLOSED] [1.0] CommandColumn created runtime does not appear
    By PoloTheMonk in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 30, 2010, 5:02 PM
  4. Replies: 2
    Last Post: Jul 01, 2009, 4:49 PM
  5. Replies: 3
    Last Post: Jun 05, 2008, 11:31 PM

Posting Permissions