[CLOSED] Loop through tabs

  1. #1

    [CLOSED] Loop through tabs

    Hello,

    I've asked the question in the iframe topic, but here it is again:

    I have a bunch of tabs in a tabpanel which are basically iframes with other apsx files, I don't know on beforehand how many tabs there are, and which tabs they are.
    I need to run an AjaxMethod in every open tab, called from the host of the tabpanel.

    How can I accomplish this?

    I thought of looping through tabPanel.items and for each of those items do a call to the AjaxMethod, but it doesn't seem to work.
    I have this:

    for (var atab in tabPanel.items) {
     atab.iframe.Coolite.AjaxMethods.MyMethod();
    }
    Thanks for your help.

    Kind regards,

    Reno

  2. #2

    RE: [CLOSED] Loop through tabs

    Anyone?
  3. #3

    RE: [CLOSED] Loop through tabs

    Hi,

    Try this

    for (var atab in tabPanel.items) {
     if(atab.iframe 
        && atab.iframe.dom.contentwindow.Coolite
        && atab.iframe.dom.contentwindow.Coolite.AjaxMethods
        && atab.iframe.dom.contentwindow.Coolite.AjaxMethods.MyMethod)
     
        atab.iframe.dom.contentwindow.Coolite.AjaxMethods.MyMethod();
    }
  4. #4

    RE: [CLOSED] Loop through tabs



    Thanks!

    I'm gonna test it out right now
  5. #5

    RE: [CLOSED] Loop through tabs

    Hi,

    The forum engine convert contentWindow word.


    Please note that need use big letter W in contentWindow word*
  6. #6

    RE: [CLOSED] Loop through tabs

    thanks for pointing out

    Kind regards,
    Reno
  7. #7

    RE: [CLOSED] Loop through tabs

    Hi,

    Can you confirm that problem is solved? Or you need additional help?
    *
  8. #8

    RE: [CLOSED] Loop through tabs



    Not solved yet, but I think it is something on my side that I overlooked.

    As soon as it is ok, I'll post ;-)
  9. #9

    RE: [CLOSED] Loop through tabs

    Hi,

    I found one mistake use simple for loop. Here is code should works

    for (var i = 0; i < tabPanel.items.getCount(); i++) {
       var atab = tabPanel.items.get(i);
       if(atab.iframe 
          &amp;&amp; atab.iframe.dom.contentwindow.Coolite
          &amp;&amp; atab.iframe.dom.contentwindow.Coolite.AjaxMethods
          &amp;&amp; atab.iframe.dom.contentwindow.Coolite.AjaxMethods.MyMethod())
       
          atab.iframe.dom.contentwindow.Coolite.AjaxMethods. MyMethod();
    }
  10. #10

    RE: [CLOSED] Loop through tabs

    Thanks!

Similar Threads

  1. [CLOSED] Move tabs Tabs Style Google Chrome
    By majunior in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Apr 30, 2013, 12:58 PM
  2. [CLOSED] Grid Values Loop
    By majunior in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Apr 15, 2011, 1:34 PM
  3. [CLOSED] Loop through sub menu checkmenuitems
    By rthiney in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 27, 2011, 7:35 PM
  4. gridpanel loop
    By maxdiable in forum 1.x Help
    Replies: 4
    Last Post: Jul 09, 2009, 9:37 AM
  5. [CLOSED] Loop through icons?
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Dec 11, 2008, 12:05 PM

Posting Permissions