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
  • 0
    Certified Lead Developer
    in reply to sansanw5661

    It is possible to freeze only few set of columns at first.

    To achieve, you need to use editable grid and display it side by side with spacing as NONE.

    For Pagination implement the rich text and write the logic for moving forward and backward in grid.

    For reference am attaching screen Sort how it looks.

  • 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
            )
          )
        }
      )
    )