Read only grid column fix

Is it possible to fix some columns in a read only grid?

  Discussion posts and replies are publicly visible

Parents Reply Children
  • Thank you so much.
    If you have any sample code I can use as a reference, I would be grateful.

  • 0
    Certified Senior Developer
    in reply to Ranjith shanmugam

      

    Could you please provide sample code for reference for above functionality. 

  • Here you go

    a!localVariables(
      local!items: {
        {item: "Item 1 Dummy"},
        {item: "Item 2 Dummy"},
        {item: "Item 1 Dummy"},
        {item: "Item 2 Dummy"},
        {item: "Item 1 Dummy"},
        {item: "Item 2 Dummy"},
        {item: "Item 1 Dummy"},
        {item: "Item 2 Dummy"},
        {item: "Item 1 Dummy"},
        {item: "Item 2 Dummy"},
        {item: "Item 1 Dummy"},
        {item: "Item 2 Dummy"}
      },
      a!columnsLayout(
        spacing: "NONE",
        columns: {
          a!columnLayout(
            width: "MEDIUM_PLUS",
            contents: a!gridLayout(
              headerCells: {
                a!gridLayoutHeaderCell(label: "Item"),
                a!gridLayoutHeaderCell(label: "Qty"),
                a!gridLayoutHeaderCell(label: "Unit Price")
              },
              rows: {
                a!forEach(
                  items: local!items,
                  expression: a!gridRowLayout(
                    contents: {
                      a!textField(
                        readOnly: true,
                        value: local!items[fv!index].item,
                        saveInto: local!items[1].item
                      ),
                      a!textField(
                        readOnly: true,
                        value: local!items[fv!index].item,
                        saveInto: local!items[1].item
                      ),
                      a!textField(
                        readOnly: true,
                        value: local!items[fv!index].item,
                        saveInto: local!items[1].item
                      )
                    }
                  ),
                )
              },
              rowHeader: 1
            )
          ),
          a!columnLayout(
            contents: a!gridLayout(
              columnConfigs: {
                a!gridLayoutColumnConfig(
                  width: "NARROW_PLUS",
                ),a!gridLayoutColumnConfig(
                  width: "NARROW_PLUS"
                ),a!gridLayoutColumnConfig(
                  width: "NARROW_PLUS"
                ),a!gridLayoutColumnConfig(
                  width: "NARROW_PLUS"
                ),a!gridLayoutColumnConfig(
                  width: "NARROW_PLUS"
                ),a!gridLayoutColumnConfig(
                  width: "NARROW_PLUS"
                ),a!gridLayoutColumnConfig(
                  width: "NARROW_PLUS"
                ),a!gridLayoutColumnConfig(
                  width: "NARROW_PLUS"
                ),a!gridLayoutColumnConfig(
                  width: "NARROW_PLUS"
                )
              },
              headerCells: {
                a!gridLayoutHeaderCell(label: "Item"),
                a!gridLayoutHeaderCell(label: "Qty"),
                a!gridLayoutHeaderCell(label: "Unit Price"),
                a!gridLayoutHeaderCell(label: "Item"),
                a!gridLayoutHeaderCell(label: "Qty"),
                a!gridLayoutHeaderCell(label: "Unit Price"),
                a!gridLayoutHeaderCell(label: "Item"),
                a!gridLayoutHeaderCell(label: "Qty"),
                a!gridLayoutHeaderCell(label: "Unit Price")
              },
              rows: {
                a!forEach(
                  items: local!items,
                  expression: a!gridRowLayout(
                    contents: {
                      a!textField(
                        readOnly: true,
                        value: local!items[fv!index].item,
                        saveInto: local!items[1].item
                      ),
                      a!textField(
                        readOnly: true,
                        value: local!items[fv!index].item,
                        saveInto: local!items[1].item
                      ),
                      a!textField(
                        readOnly: true,
                        value: local!items[fv!index].item,
                        saveInto: local!items[1].item
                      ),
                      a!textField(
                        readOnly: true,
                        value: local!items[fv!index].item,
                        saveInto: local!items[1].item
                      ),
                      a!textField(
                        readOnly: true,
                        value: local!items[fv!index].item,
                        saveInto: local!items[1].item
                      ),
                      a!textField(
                        readOnly: true,
                        value: local!items[fv!index].item,
                        saveInto: local!items[1].item
                      ),
                      a!textField(
                        readOnly: true,
                        value: local!items[fv!index].item,
                        saveInto: local!items[1].item
                      ),
                      a!textField(
                        readOnly: true,
                        value: local!items[fv!index].item,
                        saveInto: local!items[1].item
                      ),
                      a!textField(
                        readOnly: true,
                        value: local!items[fv!index].item,
                        saveInto: local!items[1].item
                      )
                    }
                  ),
                )
              },
              rowHeader: 1
            )
          )
        }
      )
    )