A client-server web framework built on Node.js that allows front-end developers to easily create a 100% SEO compliant, component MVC structured web application with an optimized first page load.
Request initial page from server that renders a collection view, where the collection is empty
Once loaded in the client browser, add an item to the collection
Bugs:
After step 1, the 'EmptyItemView' has a state of detached
After step 2, the new 'ItemView' has a state of detached and neither 'attach()' nor 'afterRender()' are executed for the new view. I believe adding the EmptyItemView has the same problems.
If you paste the following code block into lib/public/views/collection.js it will resolve problem 2.
_addItemView: function (model, collection, options) {
var self = this;
flexo.CollectionView.prototype._addItemView.call(self, model, collection, {
success: function(view) {
var $el = collection.length ? self._getViewEl(model) : self._getCollectionTarget(collection);
view.attach($el[0], {
error: options.error,
success: function () {
view.afterRender();
if (options.success) {
options.success(view);
}
}
});
},
error: options.error
});
}
I'm not sure what the best way to resolve these issues are, I have only had time to identify the cause for now and the code above is just something I quickly threw together.
Steps to reproduce:
Bugs: After step 1, the 'EmptyItemView' has a state of detached After step 2, the new 'ItemView' has a state of detached and neither 'attach()' nor 'afterRender()' are executed for the new view. I believe adding the EmptyItemView has the same problems.
If you paste the following code block into lib/public/views/collection.js it will resolve problem 2.
I'm not sure what the best way to resolve these issues are, I have only had time to identify the cause for now and the code above is just something I quickly threw together.
Adam.