[#77,model][s]: add summary function to product infobox style summary for a doc (all keys and values atm).
This commit is contained in:
10
src/model.js
10
src/model.js
@@ -198,6 +198,16 @@ my.Document = Backbone.Model.extend({
|
|||||||
val = field.renderer(val, field, this);
|
val = field.renderer(val, field, this);
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
|
},
|
||||||
|
|
||||||
|
summary: function(fields) {
|
||||||
|
var html = '';
|
||||||
|
for (key in this.attributes) {
|
||||||
|
if (key != 'id') {
|
||||||
|
html += '<div><strong>' + key + '</strong>: '+ this.attributes[key] + '</div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return html;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user