This is a migrated thread and some comments may be shown as answers.

On Item Click Event?

2 Answers 39 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Saad
Top achievements
Rank 1
Saad asked on 09 Dec 2008, 04:20 PM
I have created the following code to make three radgrids visible and invisible by clicking three options on radToolBar...
I have called the following function on toolBarItemClicked event, but only the first radgrid is working accordingly while pthers arent. Please help!

function

OnMainMenuItemClick(sender, args) // fine

 

{

 

var itemText = args.get_item();

 

 

if(itemText.get_text() == "NoteBook")

 

{

$find(

"<%= RadGrid_NoteBook.ClientID %>").get_element().style.display = "";

 

$find(

"<%= RadGrid_Networks.ClientID %>").get_element().style.display = "none";

 

$find(

"<%= RadGrid_Friends.ClientID %>").get_element().style.display = "none";

 

}

 

else if(itemText.get_text() == "Networks")

 

{

$find(

"<%= RadGrid_NoteBook.ClientID %>").get_element().style.display = "none";

 

$find(

"<%= RadGrid_Friends.ClientID %>").get_element().style.display = "none";

 

$find(

"<%= RadGrid_Networks.ClientID %>").get_element().style.display = "";

 

}

 

else if(itemText.get_text() == "Friends")

 

{

$find(

"<%= RadGrid_NoteBook.ClientID %>").get_element().style.display = "none";

 

$find(

"<%= RadGrid_Networks.ClientID %>").get_element().style.display = "none";

 

$find(

"<%= RadGrid_Friends.ClientID %>").get_element().style.display = "";

 

}

}

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 09 Dec 2008, 04:35 PM
Hi saadi,

Does the code get executed at all? You can test by putting alert messages in the if statements:

if(itemText.get_text() == "NoteBook")
{
     alert("NoteBook");
     ....
}

Sincerely yours,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Saad
Top achievements
Rank 1
answered on 09 Dec 2008, 04:38 PM
LISTENNNNN...........
Its again not working!!! Is there any problem of applying javascript that is no reliablilty with radcontrols...???
I have become fed up of applying javascripts with almost every control of telerik but all are not working.....WHY???
Tags
ToolBar
Asked by
Saad
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Saad
Top achievements
Rank 1
Share this question
or