ability to create custom note types

This commit is contained in:
yuri
2015-08-05 10:36:27 +03:00
parent 01039b9881
commit 36d6483a51
2 changed files with 14 additions and 6 deletions
@@ -1,7 +1,10 @@
{
"collection": "collections/note",
"recordViews":{
"edit":"Note.Record.Edit",
"editQuick":"Note.Record.Edit"
}
"collection": "collections/note",
"recordViews":{
"edit":"Note.Record.Edit",
"editQuick":"Note.Record.Edit"
},
"itemViews": {
"Post": "Stream.Notes.Post"
}
}
+6 -1
View File
@@ -25,12 +25,17 @@ Espo.define('Views.Stream.List', 'Views.Record.ListExpanded', function (Dep) {
type: 'listStream',
setup: function () {
this.itemViews = this.getMetadata().get('clientDefs.Note.itemViews') || {};
Dep.prototype.setup.call(this);
},
buildRow: function (i, model, callback) {
var key = 'row-' + model.id;
this.rows.push(key);
var type = model.get('type');
var viewName = 'Stream.Notes.' + type;
var viewName = this.itemViews[type] || 'Stream.Notes.' + type;
this.createView(key, viewName, {
model: model,