Grid reference problem

I use dhtmlxTabbar and dhtmlxGrid.
In my application is it possible to create new tabs and in this tab is then a new grid included. So I have a function which creates this tab and my grid.

function createTab(tabID) {
// here I create my new tab and my new grid. This all works without problems inside of this function
}

How is it now possible to get a reference to the grid inside of create_tab() in another function to modify it? I tried to put the grid object into the function as parameter but this does not work

myFunction(myGrid);

Maybe it is just an understanding problem from my side but it will not work…

You can create global variable which will store necessary dhtmlxGrid object.