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

Transfer and read additional XML-data in the grid data source

1 Answer 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 24 Mar 2017, 10:40 AM
I'm using Kendo UI Grid with XML as DataSource. I want to transfer additional data in the XML as the grid data.

My dataSource schema looks like this

schema: {
type: "xml",
id: "field 1",
data: "/data/dataset",
total: "/total/text()",
model: {
fields: {
field1: "field1/text()",
field2: "field2/text()"
}
}
}

My XML like this:

<total>1</total><data><dataset><field1>test</field1><field2>test</field2></dataset></data>

No i want to transfer additional data like this:

<total>1</total><data><dataset><field1>test</field1><field2>test</field2></dataset></data><additionaldata>test</additionaldata>

and i want to have access on it it in the "dataBound" event. Is it possible and if how? I hope someone can help me.

1 Answer, 1 is accepted

Sort by
0
Preslav
Telerik team
answered on 28 Mar 2017, 10:15 AM
Hi Chris,

I believe that it is not possible to access the additional data with this schema. A possible solution might be adding the additionaldata field to the data/dataset. For example,

schema: {
    type: "xml",
    id: "field 1",
    data: "/data/dataset",
    total: "/total/text()",
    model: {
        fields: {
            field1: "field1/text()",
            field2: "field2/text()",
            additionaldata: "additionaldata/text()"
        }
    }
}
<total>1</total><data><dataset><field1>test</field1><field2>test</field2><additionaldata>test</additionaldata></dataset></data>

Additionally, more information regarding the schema.data configuration is available here:

http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-schema.data

Regards,
Preslav
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Chris
Top achievements
Rank 1
Answers by
Preslav
Telerik team
Share this question
or