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.
Unfortunately, activation email could not send to your email. Please try again.

Get Menu Data by field

Thread ID:

Created:

Updated:

Platform:

Replies:

130572 May 18,2017 11:08 AM May 19,2017 08:56 AM Angular 1
loading
Tags: ejMenu
Agne
Asked On May 18, 2017 11:08 AM

Hello,

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 : []);
          $("myMenu").ejMenu({
               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 08:56 AM

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 . 
 
Regards, 
Keerthana. 
 


CONFIRMATION

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.

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.

;