[#25,view,refactor][s]: get views working with new field setup (fixes #25).
* One nastiness along the way (30m delay!) that is worth noting: flot graph was a problem because it turned out that a) (re-)render triggered by dataset attributes change and fields only got set *after* core dataset attributes and so info was rendering. * model.test.js: basic test for Dataset.toTemplateJSON
This commit is contained in:
@@ -20,4 +20,12 @@ test('Field: basics', function () {
|
||||
);
|
||||
});
|
||||
|
||||
test('Dataset', function () {
|
||||
var meta = {id: 'test', title: 'xyz'};
|
||||
var dataset = new recline.Model.Dataset(meta);
|
||||
dataset.fields = new recline.Model.FieldList([{id: 'xx'}, {id: 'yy'}]);
|
||||
var out = dataset.toTemplateJSON();
|
||||
equal(out.fields.length, 2);
|
||||
});
|
||||
|
||||
})(this.jQuery);
|
||||
|
||||
@@ -13,7 +13,7 @@ test('new DataTableRow View', function () {
|
||||
var view = new recline.View.DataTableRow({
|
||||
model: doc
|
||||
, el: $el
|
||||
, fields: ['a', 'b']
|
||||
, fields: new recline.Model.FieldList([{id: 'a'}, {id: 'b'}])
|
||||
});
|
||||
view.render();
|
||||
ok($el.attr('data-id'), '1');
|
||||
|
||||
Reference in New Issue
Block a user