Dynamic Forms

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

    Dynamic Forms

    We can hide/show panels based on another field's value.

    How to give condition as logged in user team there?

    I need to make some panels hidden for some users based on their team.

    Please help.

    Thanks in advance.
  • krishnapriya
    Senior Member
    • Aug 2017
    • 209

    #2
    In role we can set read/write roles of only fields ryt?

    How to manage panels this way?

    Comment

    • tanya
      Senior Member
      • Jun 2014
      • 4308

      #3
      Hello
      In recordView detail you can hidePanel or showPanel. Set your condition. It could be user field (this.getUser().get('fieldname')) or acl (this.getAcl().checkModel(this.model, 'stream', true)
      read src/views/record/detail.js and detail-bottom.js

      Comment

      • krishnapriya
        Senior Member
        • Aug 2017
        • 209

        #4
        I tried this.hidePanel("Payment"); in src/views/record/detail.js inside setup()

        Giving me error-
        Uncaught TypeError: Cannot read property 'setPanelStateParam' of undefined
        at n.hidePanel

        Comment

        • krishnapriya
          Senior Member
          • Aug 2017
          • 209

          #5
          If I write this.hidePanel("Payment"); in afterRender() there is no error.

          But it never hides the Payment panel.

          Am I doing some mistake?

          Please help.

          Comment

          • tanya
            Senior Member
            • Jun 2014
            • 4308

            #6
            selector this.$el.find('.panel[data-name="'+name+'"]')
            check data-name attribute for your panel

            Comment

            • krishnapriya
              Senior Member
              • Aug 2017
              • 209

              #7
              Sorry, I couldn't see data-name attribute.

              Click image for larger version

Name:	panel.png
Views:	412
Size:	9.0 KB
ID:	33788

              This is all what I see.

              Tried- this.$el.find('.panel[data-name="Payment"]').addClass("hidden"); // Not working

              Comment

              • tanya
                Senior Member
                • Jun 2014
                • 4308

                #8
                you panel has no data-name attribute. add to panel definition the name (in clientDefs or where you added it)

                Comment

                • krishnapriya
                  Senior Member
                  • Aug 2017
                  • 209

                  #9
                  I am so happy Thank you so much Tanya. It worked.

                  Comment

                  Working...