This is a migrated thread and some comments may be shown as answers.

Bind #text field

2 Answers 27 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mikael
Top achievements
Rank 1
Mikael asked on 20 Aug 2012, 11:14 PM
I'm stuck!
My data looks something like this:
{
    "@type":"object",
    "expand":{"@type":"string","#text":"editmeta,
    "key":{"@type":"string","#text":"10005"}
}
 
and I'm trying to bind the key['#text'] field to a column in my grid as:
$("#grid").kendoGrid({
    columns: [
        {
            field: "key",
            title: "key",
        }
    ],
    dataSource: {
        data: data.issues.item,
        pageSize: 10
    },
    selectable: true,
    pageable: true,
});
 
The sample above only returns "{object Object}", which I expected, but I can't figure out how to get the #text field ;) I've tried defining a schema with the source and I've also used "key[\"#text\"] without any success...

Thanks
Mikael

2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 24 Aug 2012, 07:27 AM
Hello Mikael,

 
You need to escape the "#" symbol, because it is part of our template syntax. Here is a simple jsFiddle demo, which shows how to achieve your goal.

Kind regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Mikael
Top achievements
Rank 1
answered on 24 Aug 2012, 11:24 AM
Great, thanks!!!
Tags
Grid
Asked by
Mikael
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Mikael
Top achievements
Rank 1
Share this question
or