I want to create a view of case/matter entity. I don't want the scope of it, just the list of items in case/matter entity as a link. Somewhat similar to the way activities is done. Is there a source code I can look at to see how to customize it?
createview list for entity?
Collapse
X
-
Tags: None
-
I can suggest to search in file contents by keywords 'activities', 'activity'. Ir's a side panel. Side panels are views. Side panels are defined in clientDefs.If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks. -
PHP Code:Espo.define('advanced:views/quote-item/modals/viewItems','views/modal',function (Dep) { return Dep.extend({ template: 'advanced:quote-item/modals/viewItems', scopeList: ['Task','Call','Expense'], viewRadio: null, data: function () { return { scopeList: this.scopeList, viewRadio: this.viewRadio } }, events: { 'change .view_scope_switch input[name="scope"]': function () { this.viewRadio = $('.view_scope_switch input[type="radio"]:checked').val(); } }, setup: function () { Dep.prototype.setup.call(this); } }); });
PHP Code:this.createView('dialog','advanced:views/quote-item/modals/viewItems',{}, function(view){ view.render(); view.notify(false); this.listenToOnce(view,'select',function(model){ var obj = model.viewRadio; console.log(obj); view.close(); },this); }.bind(this));
Last edited by worldmiros; 03-02-2016, 10:30 PM.Comment
-
Not sure. Such situations happen. No errors occurs before close gets invoked?If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.Comment
-
No errors occur before close gets invoked. If I were to write this.close() and/or console.log(this.viewRadio) in the events object (first code), either line of code works. The second code is in directory, 'advanced:views/quote-item/fields/name'. model.viewRadio or model.get('viewRadio') doesn't work. My goal is to render the view of the scopelist, grab the value when user clicks a radio by model.get('viewRadio'), then close.Comment
-
Any help here? I want to the get the value of the radio the user click and close the window, but i'm not getting it.Comment
-
Such situations require some debug. It's not obvious. There can be some problem. Did you try .remove() instead of close? Or setTimeout(function () { view.close();}.bind(this), 100);If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.Comment
-
Directory of code below, 'advanced:views/quote-item/modals/viewItems'.
PHP Code:events: { 'click .view_scope_switch input[type="radio"]': function () { this.viewRadio = $('.view_scope_switch input[type="radio"]:checked').val(); this.close(); this.createView('dialog','Modals.SelectRecords',{ scope:this.viewRadio, createButton:false },function(view){ view.render(); view.notify(); this.listenToOnce(view,'select',function(model){ },this); }.bind(this)); } }
Comment
-
Maybe if I use Dep.prototype.selectProduct.call(this) would allow me access to the method located in directory, 'advanced:views/quote-item/fields/name'? If so, after the call, I can use this.selectProduct(model) to add a new item to quoteItems?Comment
-
Comment