3

As you can see, I'm new here - I realy tried to search, but didn't find something to solve my problem.

so here is my problem. if I do this:

console.log($("#grid").data("kendoGrid")._data);

This shows in the console like this:

So I understand this: There is an Array with an Object with data. I need, what is in Description --> the "sd" but i can't get access to it.

so, i tried to get the data from description like this:

console.log($("#grid").data("kendoGrid")._data[0].toString(Description));

This shows in the console like this:

Then i tried to get access with this

console.log(JSON.stringify($("#grid").data("kendoGrid")._data[0].Description));

This shows in the console like this:

What I need is the "sd" from the first picture.

UPDATE:

here is the output from JSON.stringify($("#grid").data("kendoGrid")._data[0] console ouput

and if i do this without stringify, there is just a freespace in the console.log :-/

Huangism
  • 16,278
  • 7
  • 48
  • 74
MrLakish
  • 31
  • 6
  • 1
    Show us what `JSON.stringify($("#grid").data("kendoGrid")._data[0]` produces. What you want is `$("#grid").data("kendoGrid")._data[0].Description` without stringify – charlietfl Jan 23 '18 at 14:27
  • without stringify, there is just a blank line in the console - no input like the "sd" which i searched and need :( – MrLakish Jan 23 '18 at 14:42
  • can you show us the JSON string – Mohamed Sa'ed Jan 23 '18 at 14:43
  • 2
    Ok...that means you are trying to access that array or object before it is populated. What you were seeing in console is a live object not a snapshot – charlietfl Jan 23 '18 at 14:44
  • ah ok, this could be. is there a way, to get access to it? or do i have to store it? @Mohamed SaȜed it is shown in the last picture – MrLakish Jan 23 '18 at 14:46
  • Can you again store that stringify data in a variable and parse it ? – Negi Rox Jan 23 '18 at 15:11
  • when i store it in an new variable, the "description" is empty. I think it is how @charlietfl told it above. but i dind't figured out, how to populate it^^ when I solve my problem, i will update this here :-) – MrLakish Jan 23 '18 at 15:24

0 Answers0