Sha256: 585d796cf6bfc44508c48dfd08eba7c61cc3846c6a688d22d5c61ecfd359b8d1

Contents?: true

Size: 1.06 KB

Versions: 12

Compression:

Stored size: 1.06 KB

Contents

({
  initComponent() {
    this.callParent();

    // dup is a non standard button, so we have to explicitly manage
    // its clickability
    this.getSelectionModel().on(
      "selectionchange",
      function(selModel) {
        this.actions.dupInForm &&
          this.actions.dupInForm.setDisabled(
            !selModel.hasSelection() || !this.permissions.create
          );
      },
      this
    );
  },
  // copied from basepack grid's onEditInForm
  netzkeOnDupInForm() {
    const selModel = this.getSelectionModel();
    const recordId = selModel.getSelection()[0].getId();
    this.netzkeLoadComponent("edit_window", {
      title: "Duplicate in Form",
      serverConfig: {
        record_id: recordId
      },
      callback(w) {
        w.show();
        const form = w.items.first();
        form.baseParams = {
          dup: true
        };
        w.on(
          "close",
          function() {
            if (w.closeRes === "ok") {
              this.store.load();
            }
          },
          this
        );
      },
      scope: this
    });
  }
});

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
marty-14.3.0 app/components/marty/mcfly_grid_panel/client/mcfly_grid_panel.js
marty-14.0.0 app/components/marty/mcfly_grid_panel/client/mcfly_grid_panel.js
marty-13.0.2 app/components/marty/mcfly_grid_panel/client/mcfly_grid_panel.js
marty-11.0.0 app/components/marty/mcfly_grid_panel/client/mcfly_grid_panel.js
marty-10.0.3 app/components/marty/mcfly_grid_panel/client/mcfly_grid_panel.js
marty-10.0.2 app/components/marty/mcfly_grid_panel/client/mcfly_grid_panel.js
marty-10.0.0 app/components/marty/mcfly_grid_panel/client/mcfly_grid_panel.js
marty-9.5.1 app/components/marty/mcfly_grid_panel/client/mcfly_grid_panel.js
marty-9.5.0 app/components/marty/mcfly_grid_panel/client/mcfly_grid_panel.js
marty-9.3.3 app/components/marty/mcfly_grid_panel/client/mcfly_grid_panel.js
marty-9.3.2 app/components/marty/mcfly_grid_panel/client/mcfly_grid_panel.js
marty-9.3.0 app/components/marty/mcfly_grid_panel/client/mcfly_grid_panel.js