0

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.

Chris
  • 2,953
  • 10
  • 48
  • 118
  • Your question is *very* unclear. Be more concise and accurate with your references – Amit Apr 21 '16 at 19:42
  • @Amit, I started thinking that after I posted, I'll do an edit and try and be more concise – Chris Apr 21 '16 at 19:44
  • I don't see why this question is still marked as a duplicate, because it clearly isn't a duplicate. I didn't ask how to return a response, I am getting the response. I think that before members start calling questions duplicates that the member asking the question should be given the opportunity to explain why its not a duplicate before labeling it as one, and if a member calls a questions a duplicate should at least prove how it is a duplicate – Chris Apr 21 '16 at 22:01

0 Answers0