mmmm
mmmm

Reputation: 3938

Passing url to read as a parameter in kendoui datasource

Let's say I have this kind of simple dataSource:

var TasksSource = new kendo.data.DataSource({

     transport: {
         read: {
          url: 'some url',
          dataType: "json"
        }
    }
});

And I want to use it several times, but with different urls. I couldn't find anywhere how to pass this to dataSource. And I don't want to use global variable. I was trying with custom methods, like for example setUrl: function() .. etc but eventually it didn't work

Upvotes: 2

Views: 4950

Answers (1)

Goose
Goose

Reputation: 3279

Once you create the DataSource, set the url value like this:

TasksSource.transport.options.read.url = "Test";

Upvotes: 5

Related Questions