Quick Links
ASP.NET Easy Menu - How to use attachToControl and detachFromControl
Easy Menu provides two JavaScript functions that can be used to attach to or detach from an element at client side:
attachToControl
- has the following syntax:
ob_em_EasyMenuID.attachToControl('ID')
detachFromControl
- method has the following syntax:
ob_em_EasyMenuID.detachFormControl('ID')
Note:
EasyMenuID
is the id of the Easy Menu we want to attach/detach, and
ID
is the id of the element we want to attach to/detach from.
Test pressing the buttons below and see how they affect the menu attached to the gray square:
Red-Like
Green-Like
Blue-Like
Yellow-Like
Gray-Like
Some Submenu 1
Some Submenu 2
Some Submenu 3
Some Submenu 4
Some Submenu 5
Another Submenu 1
Another Submenu 2
Another Submenu 3
Another Submenu 4
Another Submenu 5
Here is the code for the buttons:
<
input
type
="button"
value
="Attach First SubMenu"
onclick
="
ob_em_EasyMenu2
.attachToControl('
menuItem2
');"
>
<
input
type
="button"
value
="Detach First SubMenu"
onclick
="
ob_em_EasyMenu2
.detachFromControl('
menuItem2
');"
>
<
input
type
="button"
value
="Attach Second SubMenu"
onclick
="
ob_em_EasyMenu3
.attachToControl('
menuItem5
');"
>
<
input
type
="button"
value
="Detach Second SubMenu"
onclick
="
ob_em_EasyMenu3
.detachFromControl('
menuItem5
');"
>
<
input
type
="button"
value
="Attach Main EasyMenu"
onclick
="
ob_em_EasyMenu1
.attachToControl('
div1
');"
>
<
input
type
="button"
value
="Detach Main EasyMenu"
onclick
="
ob_em_EasyMenu1
.detachFromControl('
div1
');"
>
Note:
· If you want to attach/detach an EasyMenu to/from more than one element, you will need to specify the elements separately. You will need to use
ob_em_EasyMenu1.attachToControl('div1'); ob_em_EasyMenu1.attachToControl('div2');
ob_em_EasyMenu1.detachFromControl('div1'); ob_em_EasyMenu1.detachFromControl('div2');
"
Many thanks and I look forward to working with the Obout suite of controls for many years to come !!!
"
John Morcom
SAA Consultants Ltd.
obout.com
obout.com Home
News
Easy Menu Home
Easy Menu Home
Download
Site Map
Compare with Text Menu
Examples
- 47
Horizontal
- 15
Horizontal 1
Horizontal 2
Horizontal 3
Horizontal 4
Horizontal 5
Horizontal 6
Horizontal 7
Horizontal 8
Horizontal Right To Left
Transparent - over flash
Transparent - over iframe
MSDN
MSDN 2
With rounded corners
Keep Open
Vertical
- 3
Vertical 1
MS Vertical
Vertical Right To Left
ContexMenu
- 10
World Map
Default
Futura
VSNET
Windows
WindowsXP
Style 1
Style 2
Style 3
Right To Left
Tab Strip
- 20
Tab Strip
Tab Strip - With postback
Different Styles
- 14
TabStrip1
TabStrip2
TabStrip3
TabStrip4
TabStrip5
TabStrip6
TabStrip7
TabStrip8
TabStrip9
TabStrip10
TabStrip11
TabStrip12
Yahoo TabStrip
Parent Child Tabstrip
Tab Strip - Wizard
Tab Strip - Wizard 2
Add / Remove Tabs
Add / Remove Tabs 2
Time Picker
Features
- 46
Fast loading time
Multi Column Menu
- 2
Multi Column Submenu
Multi Column Submenu with Icons
Multiple menus
- 3
Multiple menus
Multiple menus 2
Horizontal menu and Tab Strip
Operations
- 9
ShowEvent
Add / Remove Items
Hide / Show Items
Menu item inner HTML
Attach / Detach
Menu Events
OnClientClick
Menu item postback
Show menu
Align/Position
- 4
Align
Advanced Align
Menu Offsets
Position
Integration
- 13
TreeView
- 5
Attach to TreeView
Dynamic Loading
Inside callback panel
Select the TreeView node
TreeView inside Easy Menu
AJAX Page
- 3
Inside AJAX Page panel
Inside MS AJAX panel
Add items server side
Grid
- 2
Use With Grid
Inside DataGrid column
Inside Window
Build from SiteMap
Over Java Applet
Other features
- 15
AttachTo
Menu Icons
Menu Customize
Long vertical menus
Long menu items
Disabled menu item
Sub-menus
Custom Menu Items
Using Database
Postback Persistance
Dynamic Easy Menu Item
Full Easy Menu width
Hide menu with time delay
Custom sliding effect
Custom Menu Content
Knowledge Base
- 2
Knowledge Base
Documentation
- 4
Server side
Client side
Using the correct path
ChangeLog
Products
AJAX Page
Calendar
Color Picker
Date Picker
File Upload Progress
Flyout
Grid
HTML Editor
Image Zoom
Listbox
Multilevel Listbox
Scheduler
Show
Spell Checker
Splitter
Tab Strip
TreeView
Tree_DB
Window
Menu
Context Menu
Easy Menu
Slide Menu
Text Menu
Combobox
Combobox
AJAX Autosuggest
Multilevel Combobox
State Selector
Interface Controls
Button
Checkbox
Dropdown List
Multiline Textbox
Radio Button
Textbox
ASP.NET MVC
Interface Controls
Download
Download page
Install FAQ
Tech Support
Our clients
Testimonials
Support
Support
Purchase
Purchase page
Contact Sales
License info
Sales FAQ
Customer login
Print Invoice
Installation
Company
Legal
Clients
Testimonials
Contact