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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Get Menu Data by field

Thread ID:





130572 May 18,2017 03:08 PM UTC May 19,2017 12:56 PM UTC Angular 1
Tags: ejMenu
Asked On May 18, 2017 03:08 PM UTC


I am getting data to ejMenu from WebAPI using DataManager and converting it to local data. I want to get all objects custom field data, but do not know how to do it.

In treeView there is method getTreeData(id), but in ejMenu I do not see something like that method...

I am posting data like this:
loadMenu() {
     var MenuObj = $("#myMenu").data("ejMenu");

     var dataManager = new ej.DataManager({ url: urlToWebAPI, crossDomain: true, adaptor: new ej.UrlAdaptor()});
     var query =  new ej.Query();

     queryPromise.done(function(e) {
          var retriveData = (e.xhr && e.xhr.responseJSON && e.xhr.responseJSON.d) ? e.xhr.responseJSON.d : (e.result ? e.result : []);
               fields: { dataSource: retriveData, parentId: "ParentId", id: "Id", text: "Text", customField: "customField" }

In same method I am trying to get data like: MenuObj.model.fields.dataSource, but here I am getting null. Here I need to get all object count and their data by fields name, including customField and in other methods I need to get data by id attribute. Maybe there is a simple way to do that?

Keerthana Rajendran [Syncfusion]
Replied On May 19, 2017 12:56 PM UTC

Hi Agne, 
Thank you for contacting Syncfusion support. 
We don’t have any public method in our ejMenu similar to TreeView control to get data of menu. The way you have used to get the dataSource of menu is fine but make sure whether you are trying to get this data only after the control is rendered i.e. in the success event of DataManager. If still issue persists kindly revert by attaching a sample to reproduce the issue in our end . 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon