Click to See Complete Forum and Search --> : how can i check whether a panel or Datagrid exists or not


lrrajesh
06-06-2005, 08:35 AM
how can i check whether a panel or Datagrid exists or not using javascript


i have to hide a datagrid if the datagrid exists . otherwise no action

can anyone help me


thanks

A1ien51
06-06-2005, 10:28 AM
There are a couple of ways, but this is the simple way


try{
var elemGrid = document.getElementById("theGridId");
//do whatever
}
catch(e){
//else grid is not here
}


Eric

lrrajesh
06-07-2005, 12:49 AM
Hi eric,

thanks alot for the answer.............

it is working perfectly

thanks alot

Rajesh