Announcement

Collapse
No announcement yet.

Dynamic logic not working

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

  • Dynamic logic not working

    Click image for larger version

Name:	dynamic logic.png
Views:	433
Size:	8.4 KB
ID:	32873

    Hello,

    dynamic logic of user = 'Some user' not working.Please help

  • #2
    Hello
    Can't reproduce it on the demo.

    Comment


    • #3
      Click image for larger version

Name:	visibility.png
Views:	457
Size:	37.4 KB
ID:	32965
      This is not working. Field quantity is always visible regardless of product.
      Please help to fix this.
      ​​​​​​​Thanks

      Comment


      • #4
        Because you are on Quote view, but not on Quote item. Quote item is hidden
        Items in quote is built with other logic, and this table could be modified only with file modification

        Comment


        • #5
          Tried to modify file.

          Not working.

          Can you please help

          Comment


          • #6
            Espo.define('Advanced:Views.QuoteItem.Fields.Quant ity', 'Views.Fields.integer', function (Dep) {

            return Dep.extend({

            setup: function () {
            this.setReadOnly(true); ////////////////////////////////////////////// working


            this.listenTo(this.model, 'change', function (model) {
            if(model.get("productName")=="Afrobat Rider"){
            this.setNotReadOnly(true);
            }
            }, this);

            Dep.prototype.setup.call(this);
            }

            });
            });


            Not working.
            Is this the way of doing that?
            Please help.

            Comment


            • #7
              Hi EspoCRM users, I‘m working with the Quote module from the Advanced Pack. Changing entities works fine but I miss the configuration (calculation and

              Comment


              • #8
                Sorry I couldn't find any help with this link.

                readOnlyDisabled: false in item.js makes the field hidden, but how to make it visible again on changing product, Thats y I tried like above

                Comment


                • #9
                  client/modules/advanced/src/views/quote/record/item.js
                  add listener in afterRender

                  Comment


                  • #10
                    Tried to do with addClass("hidden") in listener written in afterRender.

                    It hides the element but it comes back suddenly.

                    afterRender: function () {
                    this.listenTo(this.getView('name'), 'change', function () {
                    this.handleField();
                    }, this);
                    }
                    handleField:function () {
                    if (this.model.get('name') == "miscellaneous") {
                    this.$el.find('input[name="quantity"]').removeClass("hidden");

                    } else {

                    this.$el.find('input[name="quantity"]').addClass("hidden");
                    }
                    },


                    Don't understand whats wrong with this code.

                    Please help

                    Comment


                    • #11
                      I had to call handleField function in every field's event listeners.

                      Now working.

                      Comment


                      • #12
                        this.getView('brand').setMode("edit"); not working

                        Comment

                        Working...
                        X