Hi
I am using RadMenu and binding data with WebService. i would like to call the webservice (or bind data on the clientside) when the radmenu is loaded instead of mouseover, can i do that?
I have done a lot of researches before i ask this question, but i don't see any examples to preload radmenu with webservice.
Thanks
I am using RadMenu and binding data with WebService. i would like to call the webservice (or bind data on the clientside) when the radmenu is loaded instead of mouseover, can i do that?
I have done a lot of researches before i ask this question, but i don't see any examples to preload radmenu with webservice.
Thanks
4 Answers, 1 is accepted
0
Hello Guo Huang,
Currently there is no public API which would allow you to preload the items. However you can use the private
_loadChildrenFromWebService method of the RadMenuItem client-side object. When the page loads you can traverse the items and call that method:
<script type="text/javascript">
function pageLoad() {
var menu = $find("<%= RadMenu1.ClientID%>");
for (var i = 0; i < menu.get_items().get_count(); i++) {
var item = menu.get_items().getItem(i);
item._loadChildrenFromWebService();
}
}
</script>
Regards,
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Currently there is no public API which would allow you to preload the items. However you can use the private
_loadChildrenFromWebService method of the RadMenuItem client-side object. When the page loads you can traverse the items and call that method:
<script type="text/javascript">
function pageLoad() {
var menu = $find("<%= RadMenu1.ClientID%>");
for (var i = 0; i < menu.get_items().get_count(); i++) {
var item = menu.get_items().getItem(i);
item._loadChildrenFromWebService();
}
}
</script>
Regards,
Albert,
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Guo Huang
Top achievements
Rank 1
answered on 15 Sep 2009, 11:03 PM
Hi Albert
Thanks for the script, exactly what i needed. I will give it a try.
Thanks again.
Thanks for the script, exactly what i needed. I will give it a try.
Thanks again.
0
Guo Huang
Top achievements
Rank 1
answered on 20 Oct 2009, 06:22 PM
Hi Albert
if i want to bind the menu using the following code, what javascript method should i call to populate data from the wcf service?
<tlrk:RadContextMenu ID="RadMenu2" runat="server" Flow="Vertical" Skin="Office2007" EnableViewState="false">
<Targets>
<tlrk:ContextMenuElementTarget ElementID="view1" />
</Targets>
<WebServiceSettings Method="LoadData" Path="GetRadMenu.svc" />
<DataBindings>
<tlrk:RadMenuItemBinding Depth="0" ExpandMode="WebService" />
</DataBindings>
</tlrk:RadContextMenu>
Thanks
0
Hello,
Currently RadMenu and RadContextMenu support Web Service loading only for sub-items. The root items must be created manually.
Root items can be manipulated on the client-side and you can manually populate them from a WS, but the easier option would be to place them in a sub-item. You can then use the code snippet to preload them if needed.
Regards,
Tsvetomir Tsonev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Currently RadMenu and RadContextMenu support Web Service loading only for sub-items. The root items must be created manually.
Root items can be manipulated on the client-side and you can manually populate them from a WS, but the easier option would be to place them in a sub-item. You can then use the code snippet to preload them if needed.
Regards,
Tsvetomir Tsonev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.