How to disable addRowLink when rows count reach certain limit?

I have a gridLayout, and I have an addRowLink where user can add row to the grid, I want to have a row counts limit like 10, when there are 10 rows, I want the link to be disabled and user can't add more rows.

How can I disable an addRowLink

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Senior Developer

    Hello  

    You will not be able to disable the addRowLink. Instead you can hide it, if the length of your data reaches 10 with a simple if() condition. If you want to display the "add new row" text even when the limit is reached and you want to make it disabled, use a rich text display field below your grid and make use of it instead of the addRowLink parameter. 

    addRowlink: if(
              length(local!myRows)>=10,
              {},
              a!dynamicLink(
                label: "Add New Row",
                value:{},
                saveInto:{}
              )
            )

Reply
  • +1
    Certified Senior Developer

    Hello  

    You will not be able to disable the addRowLink. Instead you can hide it, if the length of your data reaches 10 with a simple if() condition. If you want to display the "add new row" text even when the limit is reached and you want to make it disabled, use a rich text display field below your grid and make use of it instead of the addRowLink parameter. 

    addRowlink: if(
              length(local!myRows)>=10,
              {},
              a!dynamicLink(
                label: "Add New Row",
                value:{},
                saveInto:{}
              )
            )

Children