Code:
Espo.define('custom:views/deal/list', ['view', 'multi-collection', 'lib!DataTable', 'lib!DataTableBootstrap'], function (Dep) { return Dep.extend({ template: "custom:deal/list", setup: function () { //Dep.prototype.setup.call(this); console.log(this.data); this.fetch(function (data) { this.data = data; this.reRender(); }); console.log(this.data); }, afterRender: function () { // $('#example').DataTable({ // "dom": '<"toolbar">frtip' // }); }, data:function () { return{ } } , fetch: function (callback) { $.ajax({ type: 'get', url: "Deal/action/DealsList", success: function (response) { callback.call(this, response); }.bind(this) }); } }); });