In my kendoGrid I have a select in it and it looks like this...
select: function (e) {
var dataItem = this.dataItem(e.item);
var grid = $("#QuickEntryGrid").data("kendoGrid");
var gridRowdata = grid.dataItem(currentCell.parent());
// This is an ajax function
ItemsForGrid(dataItem.ItemID);
gridRowdata.set("Description", dataItem.AreaDescription);
}
function ItemsForGrid(id) {
$.ajax({
type: "GET",
url: URLParams.GridItems + "?ItemId=" + id,
dataType: "json",
contentType: "application/json; charset=utf-8",
success: function (data, textStatus, jqXHR) {
// This is the function that holds the javascript object that I need to access
ItemHolder(data);
}
});
}
function ItemHolder(data) {
myItems = {
y : data[0].ItemDescription
}
return myItems;
}
In my Select (in my grid), I would like to access the properties of my object that is in the function, so i can set my gridRowdata in my select statement...How do I go about doing this?
EDIT
To be a little more concise and clear in my question... When the select is called from my kendoGrid, I have a function that is an ajax function, on the success of the ajax call (ItemsForGrid) is a function that I pass the returned data to (ItemHolder) and I use the data that was passed to it to create an object.
Now that the ItemsForGrid has been called and its went on and populated the myItems object in the ItemHolder function, if you take a look at the select function of my grid, you can see that I have a
gridRowdata.set("Description", dataItem.AreaDescription);
but what I want to be able to do is get the properties of myItems that is in the ItemHolder function and use those properties...So the
gridRowdata.set("Description", dataItem.AreaDescription);
can look like this
gridRowdata.set("Description", myItems.y);
I did read the link that was supplied and I believe that this question is different than the answers in the link provided.