If I wanted to create a window when a user can select different entity's items from quoteitems, how would i go about doing that? should i look into getmodelfactory?
Quote entity->Items. Select any entity from the QuoteItem->"up" arrow interface
Collapse
X
-
-
yuri I tried looking everywhere in the source code to try to customize quoteitems. Which is, once user selects, [data-action="selectProduct"], (file: client/modules/advanced/src/views/quoteitem/fields/name.js) an interface pops up. There is buttons (ex. Task, Call) on the interface, and user can view the entities' items to select. There is a default scope's items viewed. Also create a button that allows users to close the interface. Anything that comes close to what I want to do is, client/modules/crm/src/views/calendar/modals/edit.js.Comment
-
-
In name.js for quoteitems, i want to hide or not display items that are already exist on the itemlist in quote entity.
PHP Code:var quote = this.getParentVew().getParentView().model; this.createView('dialog',viewName){ scope: 'Entity', //whatever entity's name createButton: false, filters: myfilter }, function (view){ var myitemList = quote.get('itemList'); myitemList.forEach(function(myname){ if(myname.name == ){ //not sure how to compare myname.name to any row's items listed in the scope //hide row } view.render(); this.notify(false); } });
Comment
-
client/modules/advanced/src/views/quoteitem/name.js
PHP Code:this.getModelFactory().create('Task',function(model){ model.id = quote.get('accountId'); var itemList = quote.get('itemList'); this.createView(model,'Modals.SelectRecords',{ scope:model, createButton: false, filters: filters, primaryFilterName: 'completed' },function(view){ var self = this; itemList.forEach(function(myname){ if(myname.name == model.get('name')){ return false; } view.render(); self.notify(false); this.listenToOnce(view,'select',function(listenmodel){ view.close(); this.selectProduct(listenmodel); },this); }); }.bind(this)); });
Last edited by worldmiros; 02-03-2016, 09:21 PM.Comment
-
This question is more about javascript language rather than espocrm,
PHP Code:this.getModelFactory().create('Task',function(model) { }.bind(this)); // bind !!!
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
-
My task is to when user clicks on [data-action="selectProduct"] in quoteitem, interface pops up with a default scope being viewed. They are two buttons (or radio), which allow user to alternate between scopes. And if an item exist on the quote's itemlist, then that item is no longer displayed on the scope to click. I'm struggling trying to figure how to do that because i knew backbonejs,underscorejs,requirejs,and smarty existed only after downloading espocrm. I'll try to figure it out and read every line of code.Last edited by worldmiros; 02-04-2016, 06:01 PM.Comment
-
I took a shortcut instead to change the scope for now. I'll figure out how to do what I really want once I get a better understanding of the client side code, it's frameworks, and smarty template.Comment
Comment