Using a promise object as data source

Using a promise object as data source

AlexandreAlexandre Posts: 3Questions: 1Answers: 0

Lets assume that I have the following code:
ListById: function (id) { return $.post('/DRE/ListById', { "id": id }).then(function (response) { return response; }); }
That would return a JSON, how can I use this function as datasource?

Answers

  • AlexandreAlexandre Posts: 3Questions: 1Answers: 0

    I actually solved my problem, here's what i've done just for reference:
    "ajax": function (data, callback, settings) { $.when(Trash.ListById($("#test").val()).done(function (ret) { callback(ret); })); settings.sAjaxDataProp = ''; },

This discussion has been closed.