views:

21

answers:

1

Hi,

I have a problem with ASPxPageControl with EnableCallbacks property set to true.

In this case when I have a couple of grids on each tab javascript doesnt see ClientInstanceNames of grids which are on different then active pages.

I want to have possibility that on the change active page if current page hax index (for example 3) then refresh grid which is on this page.

I think that once I used javascript like that:

if (document.getElementById("MyClientInstanceName") != null){
    MyClientInstanceName.Refresh();
}

otherwise there was selecting in callback so it worked great.

But now it doesnt work cause there is always null even when that tab was opened.

I use ClientID which is very ugly and long but it makes it all work for now.

Is there any other way to findout if clientInstanceName is available from javascript ?

Thanks for help

A: 

Try this code:

var grid = eval("MyClientInstanceName");
if(grid) { 
  // your code
}

It should work.

DevExpress Team
Unfortunately there is an error message:No definition for MyClientInstanceName :(
gruber
Indeed, you should surround it with the try catch block: try { var obj = eval("MyClientInstanceName"); // obj exitst } catch(e) { }
DevExpress Team