We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Contextmenu separator and destroy

Good morning,

I'm using ejMenu as Contextmenu and I can't find a way to display a separator between two entries, I tried to set the separator class on a li, but no luck.

I need to fire the destroy method on a created ejMenu, what is the syntax? After the destroy the element will still be in the DOM right?

I report and issue about the docs and api reference on ejMenu; some methods and members are not right (e.g.. contextMenuTargetID or showContextMenu); can you fix it?

A more general question, in these day of usage I found some point to fix on the docs and api reference; how can I report them without open a thread for each of them?

Kind regards,
Irvin Dominin

3 Replies

SN Sasikala Nagarajan Syncfusion Team January 12, 2015 12:44 PM UTC

Hi Irvin Dominin,

Query 1: I'm using ejMenu as Contextmenu and I can't find a way to display a separator between two entries, I tried to set the separator class on a li, but no luck.

We can add the separator between two entries in context menu by inserting new li with class “e-separator” between that two entries. Please refer the below code snippet. In online sample of our context menu, we have mentioned that the class name as “separator” instead of “e-separator” by mistakenly. We will change and refresh the online samples.

[Html]

<ul id="contextMenu">

    <li><a>Cut</a></li>

    <li><a>Copy</a></li>

    <li><a>Paste</a></li>

    <li class="e-separator"></li>  //separator between nodes (paste and comment)

    <li><a>Comments</a></li>

    <li><a>Links</a></li>

    <li><a>Clear Formatting</a></li>

</ul>   

Query 2: I need to fire the destroy method on a created ejMenu, what is the syntax?

We can destroy the ejMenu using our destroy() method. Please find the below code snippet to destroy the ejMenu.

[Script]

    var menuObj = $("#contextMenu").data("ejMenu");

    menuObj.destroy();

Query 3: After the destroy the element will still be in the DOM right?

Yes. After we destroy the ejMenu, the elements will still remain in Dom. So that we can restore the ejMenu again if we needed.

Query 4: I report and issue about the docs and api reference on ejMenu; some methods and members are not right (e.g.. contextMenuTargetID or showContextMenu); can you fix it?

We will let you know that, in 12.2.0.36 version of essential java script we made some changes in API names. So your reported API “contextMenuTargetID” now changed as “contextMenuTarget” also “showContextMenu” changed as “show”.

Query 5: A more general question, in these day of usage I found some point to fix on the docs and API reference; how can I report them without open a thread for each of them?

You can report your queries in this thread itself. We will analyze and forward your query to the corresponding team internally. They will contact you with a solution as soon as possible.

Please let us know if you have further queries,

Regards,

Sasikala Nagarajan

 


ID Irvin Dominin January 12, 2015 01:22 PM UTC

Hi,

I set the e-separator class and is working correctly, but no for submenu separators they are displayed like:


by inspecting it I see that the css rule margin: 2px 0 2px 18% for .e-menu .e-list>ul li.e-separator cause the issue.

Can you fix this?

Kind regards,
Irvin Dominin


SN Sasikala Nagarajan Syncfusion Team January 13, 2015 01:11 PM UTC

Hi Irvin Dominin,

We have analyzed your query and attached image. This is the default style in submenu. So we are not consider that as an issue. For your convenience we have override the existing CSS to achieve your requirement.

Please add below styles in your CSS section to achieve your requirement.

[CSS]

.e-menu li.e-separator

              {

              margin:0px !important;

              }

Please let us know if you have further queries,

Regards,

Sasikala Nagarajan



Loader.
Live Chat Icon For mobile
Up arrow icon