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 Senior Developer
    in reply to sansanw5661

    What do you meant by freeze? If you don't want to sort that column, then remove the sortfield in the grid column

  • There are many columns in a read only grid, so I want to make the first 6 columns fixed.

  • 0
    Certified Senior Developer
    in reply to sansanw5661

    Fixed in the sense that you want to show those 6 columns to every user?

    if that is the case, then you can go through the link to conditionally hide the grid columns.

    If you want to fix the 6 columns like in grid similar to fixing the columns in excel sheet, its not possible in Appian

  • Thanks!

    I found out that I can't do this with Appian.

  • 0
    Appian Employee
    in reply to sansanw5661

    Yeah it's currently possible to freeze the row header by setting a height for the grid, but unfortunately it isn't possible to freeze columns. I have seen some customers simulate this by putting two grids next to each other, but obviously the user experience isn't perfect for doing that. Like others have said though, there may be other solutions that give you the intent of what you're doing (e.g. showing / hiding columns) even if it doesn't give the exact behavior of freezing columns.

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