Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by rahul on Mar 23, 2009 16:42
open dhtmlx forum
dhtmlxtoolbar attach to a specific tab need it asap.

hi,

we are using dhtmlx2.0 licensed

How to attach dhtmltoolbar to a specific tab

For example (DHX DB Admin sample site)
http://www.dhtmlx.com/docs/products/demoApps/dhtmlxDBAdmin/index.html

When ever you select any table (employees), a new tab is creating and which will have its own toolbar, i try to find an example about it. but i couldnt find, can you send me steps how to implement toolbar to a specific tab.

regards
rahul.
Answer posted by Alex (support) on Mar 24, 2009 04:45

Hello, 

You can use attachToolbar() method. But the libraries of dhtmlxwindows and dhtmlxtabbar_wins.js must be also included:

tabbar.cells(tabId).attachToolbar();

Unfortunately, we don't have a ready sample.

Answer posted by Rahul on Mar 24, 2009 05:42
Hi,

I did that but its not working what js files do i need to include for that ?
Answer posted by Rahul on Mar 24, 2009 05:57

         webBar  = parent.dhxTabbar.cells("TelephoneLines").attachToolbar();
           webBar.loadXML("../dhtmlxtoolbar.xml?etc="+new Date().getTime());
           webBar.attachEvent("onClick",function(id){
            switch(id){
            case "1":
                alert("Not Implemented!");
                break;
            case "2":
                alert("option 2!");
                    break;            
            case "3":
                alert("option 3!");
                    break;
            case "4":
                alert("option 4!");
                break;
            }
         }
        );


        for this code i am getting the following error
   this._cells is undefined
this.tabbar.adjustOuterSize();this.tabb...st[1])}}};this.dhx_Event();return this};  in dhtmlxwindows.js (line 86)

can you find a solution for this asap

Answer posted by Alex (support) on Mar 24, 2009 07:58

Sorry for the misleading inforamtion. The provided approach can be used if tabbar is inside layout.

If the tabbar is not placed inside layout, the correct code is:

var wins = new dhtmlXWindows();

var toolbar = tabbar._cells(wins,"TelephoneLines").attachToolbar();
toolbar.loadXML("../dhtmlxtoolbar.xml");

Please, check that dhtmlxwindows_wtb.js is included. This file is necessary for window and toolbar implementation.

Also  dhtmlxtabbar_wins.js (the tabbar extension) is necessary.

Answer posted by Rahul on Mar 24, 2009 10:33
Still i am getting the same Error


this._cells is undefined
this.tabbar.adjustOuterSize();this.tabb...st[1])}}};this.dhx_Event();return this};                                   at               dhtmlxwindows.js (line 86)




Answer posted by Alex (support) on Mar 25, 2009 03:30

Please, take a look at the attached sample. 

Also you can use a simple way to toolbar initialzation:

You can just place the toolbar container into the necessary tab and call toolbar intialization code.

Attachments (1)