Announcement

Collapse
No announcement yet.

Quote entity->Items. Select any entity from the QuoteItem->"up" arrow interface

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    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?

    Comment


    • #17
      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


      • #18

        You can insert such buttons into template:

        /client/modules/advanced/res/templates/quote-item/fields/name/edit.tpl

        Comment


        • #19
          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
          createButtonfalse,
          filtersmyfilter
          }, 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);
            }
          }); 
          How do I compare the itemlist to the items in the scope? And is there a function to hide it, when the scope is rendered?

          Comment


          • #20
            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,
                    
            createButtonfalse,
                    
            filtersfilters,
                    
            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));
            }); 
            Hi, yuri, for the code above, am i in the ballpark of filtering the scope to show items that are not listed already in the quote's itemlist? Keep getting errors such as, "uncaught typeerror: this.createview is not a function", or "Server side error 404: Controller '[object Object]' is not found", or no popup interface.
            Last edited by worldmiros; 02-03-2016, 09:21 PM.

            Comment


            • #21
              This question is more about javascript language rather than espocrm,
              PHP Code:
              this.getModelFactory().create('Task',function(model) {

              }.
              bind(this)); // bind !!! 
              There are a

              Comment


              • #22
                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


                • #23
                  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

                  Working...
                  X