Skip to content

Commit

Permalink
potential fix for timwis#104
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Silverberg committed Jan 9, 2016
1 parent 0b5665b commit 3a3083f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/scripts/views/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,27 @@ module.exports = Card.extend({
ajax: function (data, callback, settings) {
self.collection.search = data.search.value ? data.search.value : null


self.collection.getRecordCount().done(function (recordCount) {
self.recordsTotal = self.recordsTotal || recordCount
self.collection.offset = data.start || 0
self.collection.limit = data.length || 25
self.collection.order = data.columns[data.order[0].column].data + ' ' + data.order[0].dir
self.collection.fetch({
success: function (collection, response, options) {
tableData = _.map(collection.toJSON(), function(item){
item = _.each(item, function(v,k){
if(typeof v === 'object'){
console.log(v)
item[k] = JSON.stringify(v)
}
})
console.log(item)
return item
})

callback({
data: collection.toJSON(),
data: tableData,
recordsTotal: self.recordsTotal,
recordsFiltered: recordCount
})
Expand Down

0 comments on commit 3a3083f

Please sign in to comment.