On Change Event

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • krishnapriya
    Senior Member
    • Aug 2017
    • 209

    On Change Event

    Hi,
    I have one enum field in quotes- currency
    I am trying to get that field's onchange event. Both alerts not working. What is missing in my code? Please help.
    Thanks.

    My code:

    Espo.define('Advanced:Views.Quote.Fields.Currency' , 'Views.Fields.Enum', function (Dep) {
    return Dep.extend({
    setup: function () {
    Dep.prototype.setup.call(this);
    this.events['click [data-action="selectProduct"]'] = this.actionSelectProduct;
    this.on('change', function () {
    alert('changed');
    }, this);
    },
    actionSelectProduct: function () {
    alert('actionSelectProduct');
    }
    });
    });
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Hello

    client/src/views/fields/base.js

    Comment

    • krishnapriya
      Senior Member
      • Aug 2017
      • 209

      #3
      Sorry, I couldn't understand the mistake in my code.


      Espo.define('Advanced:Views.Quote.Fields.Currency' , 'Views.Fields.Enum', function (Dep) {
      return Dep.extend({
      setup: function () {
      Dep.prototype.setup.call(this);

      this.listenTo(this.model, 'change:currency', function (model) {
      alert('ok');
      }, this);
      }
      });
      });


      Not working. Please help

      Comment

      • tanya
        Senior Member
        • Jun 2014
        • 4308

        #4
        Code:
        setup: function () {
        Dep.prototype.setup.call(this); 
        console.log('loaded view');
        this.listenTo(this, 'change', function (model) {
        console.log('ok');
        }, this); 
        }

        Comment

        • krishnapriya
          Senior Member
          • Aug 2017
          • 209

          #5


          Hello,

          How can I get quote/currency change event in QuoteItem /name.js

          Espo.define('Advanced:Views.QuoteItem.Fields.Name' , 'Views.Fields.Varchar', function (Dep) {

          return Dep.extend({

          setup: function () {

          this.listenTo(this.model, 'change:amountCurrency', function (model) {
          alert('ok');
          }, this);
          }

          }

          Not working.
          Please help.
          Thanks.

          Comment

          • krishnapriya
            Senior Member
            • Aug 2017
            • 209

            #6
            Instead of this.model how can I use quote model.

            Please help

            Comment

            Working...