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?