Tabbar and grid

Hi, i just downloaded the 1.2 version of tabbar component and i was trying to load a grid (dhtmlxTreeGrid_v14_Pro_70813) on one tab with the following settings:









This is get_tabs.php (it’s php because later i want to load the tabs from DB):

<?php

header(“Content-type:text/xml”);

echo “<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>”;

echo “”;

echo “”;

echo “BG”;

echo “”;

echo “”;

?>



And the page that has the grid is bg.php:









Everything loads great, but now i need a function in bg.php that has a for, i don’t know why when i insert a for in the javascript code everything stops working, the tab stays empty and no error is shown by ie. I deleted the function with the for and started to work fine again, then i added this line “for(i=0;i<3;i++) alert(i);” at the beginning of the script and it stopped working again. Please help me i’ve been dealing with this for hours.



Thanks in advance

Problem caused by js code detection in dthmlxtabbar, while loading data in AJAX mode, the data can’t be simple injected as innerHTML  ( in such case javascript in code will not be correctly processed ), so tabbar after loading data track all script zones and evaluate them.

      dhtmlXTabBar.prototype._resolveContent=function(id,val){
         var z=val.match(/<script[^>]>([^<]+)</script>/g);

used RegExp is pretty simple and  it will fail if “<” char will be found in code

You can
    a) move such functionality in main html file and just call a function by name
or
    b) update described regexp so it will work for you code as well
         if you have single script tag per page it can be updated as
         var z=val.match(/<script[^>]
>([.\n]+)</script>/g);


   


hi, thanks for your reply, i used the first solution, the second one didn’t work.



Thanks