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

Is possible to add a custom attribute a to a datasource?

2 Answers 549 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
rlapao
Top achievements
Rank 1
rlapao asked on 21 Apr 2012, 07:23 PM
Imagine that I have a kendoui datasource.
Is it possible to add a custom property/attribute like this ?
var dataSource = new kendo.data.DataSource({
    xpto = "3", <---
    transport: {
        read: {
            // the remote service url
            url: "http://search.twitter.com/search.json",
            // JSONP is required for cross-domain AJAX
            dataType: "jsonp",
            // additional parameters sent to the remote service
            data: {
                q: "html5"
            }
        }
    },
    // describe the result format
    schema: {
        // the data which the data source will be bound to is in the "results" field
        data: "results"
    }
});

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 23 Apr 2012, 09:56 AM
Hello Ricardo,

Yes, you can add custom properties to any Kendo widget, which will then be available via

widgetObject.options.propertyName

However, you should use the correct

propertyName : value

syntax, instead of "=".

Greetings,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
rlapao
Top achievements
Rank 1
answered on 23 Apr 2012, 11:53 AM
Thanks a lot Dimo.
Tags
Data Source
Asked by
rlapao
Top achievements
Rank 1
Answers by
Dimo
Telerik team
rlapao
Top achievements
Rank 1
Share this question
or