Announcement

Collapse
No announcement yet.

Like Report Create Modal

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

  • Like Report Create Modal

    I have created a custom modal as if the report was modal. The available fields can be parameterized. I can not do this at meetings.

    For example;
    1. Work = http://www.besnet.crm/#Report/create...duct&type=Grid
    2. Not Work = http://www.example.crm/#Meeting/create/status=Held

  • #2

    Comment


    • #3
      Yes, I do that anyway. But that does not work. tanya

      Code:
      actionCreate: function (data) {
          this.createView('createModal', 'crm:views/meeting/modals/create', {}, function (view) {
              view.render();                
              this.listenToOnce(view, 'create', function (data) {                    
                  view.close();
                  this.getRouter().dispatch('Meeting', 'create', {
                      status: data.status,
                      returnUrl: this.lastUrl || '#' + this.scope,
                      returnDispatchParams: {
                          controller: this.scope,
                          action: null,
                          options: {
                              isReturn: true
                          }
                      }
                  });
                  this.getRouter().navigate('#Meeting/create/status=' + data.status, {trigger: false});
              }, this);
          });
      }

      Comment


      • #4
        The report can take the url parameter. Can not get meetings. That's what I mean.

        Comment


        • #5
          it allows by controller report.js

          Comment


          • #6
            Originally posted by tanya View Post
            it allows by controller report.js
            Well, How can I allow this to meeting? tanya

            Comment


            • #7
              Okay, I solved.. Thanks

              Comment


              • #8
                I can do that for the status field and other areas, yeah. But how do I do this for the parent field? Not working. tanya

                My codes;

                Meeting Controller
                Code:
                create: function (options) {
                    options = options || {};
                
                    options.attributes = options.attributes || {};
                
                    if ('parent' in options) {
                        options.attributes.parent = options.parent;
                    }
                
                    Dep.prototype.create.call(this, options);
                }
                -----------------------------------------------------------------------------------------------------------------------
                Meeting list.js

                Code:
                actionCreate: function (data) {
                    this.createView('createModal', 'crm:views/meeting/modals/create', {}, function (view) {
                        view.render();                
                        this.listenToOnce(view, 'create', function (data) {                    
                            view.close();
                            this.getRouter().dispatch('Meeting', 'create', {
                                parent: data.parent,
                                returnUrl: this.lastUrl || '#' + this.scope,
                                returnDispatchParams: {
                                    controller: this.scope,
                                    action: null,
                                    options: {
                                        isReturn: true
                                    }
                                }
                            });
                            this.getRouter().navigate('#Meeting/create/parent=' + data.parent, {trigger: false});
                        }, this);
                    });
                }
                -----------------------------------------------------------------------------------------------------------------------
                Meeting create.js

                Code:
                events: {
                    'click #send': function (e) {
                        var parent = 'Contact';
                
                        this.trigger('create', {
                            parent: parent
                        });
                    }
                },
                
                setup: function () {
                    this.buttonList = [
                        {
                            name: 'cancel',
                            label: 'Cancel',
                            onClick: function (dialog) {
                                dialog.close();
                            }
                        }
                    ];  
                
                    this.header = this.translate('Create Meeting', 'labels', 'Meeting');
                }

                Comment


                • #9
                  Okay, I solved it.

                  Comment

                  Working...
                  X