javascript - angular-datatables - Can a column's renderWith function return value from a promise? -
is possible make call service/filter returns promise within column's renderwith() function? i'm attempting , output "[object object]".
vm.dtinstance = {}; vm.dtoptions = dtoptionsbuilder.fromfnpromise(myservice.getdata()) .withpaginationtype('full_numbers') .withoption('rowcallback', casesdtrowcallback) .withbootstrap() .withoption('createdrow', createdrow) .withoption('scrollx', true) .withoption('scrolly', false); vm.dtcolumns = [ dtcolumnbuilder.newcolumn(null) .withtitle('id') .renderwith(idhtml), dtcolumnbuilder.newcolumn(null) .withtitle('status') .renderwith(statushtml), ]; function casestatushtml(data, type, full, meta) { return $filter('mycustomfilter')(data.thestatus).then(function(response) { // mycustomfilter returns string return response; }) }
try ff:
function casestatushtml(data, type, full, meta) { $filter('mycustomfilter')(data.thestatus).then(function(response) { $(meta.settings.aodata[meta.row].ancells[meta.col]).text(response); }); return data; }
Comments
Post a Comment