I want to implement a user-defined feature that allows specific fields to be displayed and the order to be adjusted.
For example, I currently have 5 columns(column 1-5) in readonly grid, and the user can present 3 of them as needed and can adjust the order, e.g. display [column 1, column 5, column 3].
Is there any way to implement this feature? Can you give me some advice?
Discussion posts and replies are publicly visible
Can you please elaborate more?
The user wants to display the column they want, for example, the current gridField displays the fields [ID, NAME, AGE, STATUS], but the user wants to display [ID, STATUS, AGE] through dropdown options or other ways.
1. For the specific fields what you want to show to the user have a show when condition for the gridfields .
Yes, I can show the specific fields by the user's selected set and show when condition, but I don't have an idea of the order. because:1. We can't dynamically adjust the order of the gridcolumn, right?2. Our checkbox component can't save the values according to the order I choose, and it can't annotate the order, which makes it difficult for me to deal with the order.
Can you elaborate the use case
So you want the values of the columns in dropdown in the grid.
Ex: [ID,STATUS,AGE] are grid headers in the grid Data you want the dropdown.
Or all the grid headers in the dropdown
Not for dropdown, for example, we have a grid like below:
But there may be too many columns in this list, so users want to decide for themselves what columns to display and how to display them. for example, user want to display 3 columns and change the order, like below:
I'm not sure if there's any way to implement this, my original idea was that the user would through dropdown to select the desired column, and we showed it by show when condition, but that doesn't solve the order problem, because neither dropdown nor checkbox has the ability to generate values in the order of selection.
Not for Dropdown. This is about the functionality of the gridField and gridColumn. For example, currently our list has the following fields.
But the list here may have a lot of fields, so users want to decide what fields to display and how to display them depending on their needs. For example, user want 3 columns and change the order, like below:
I am giving you an example, you can develop like that.
a!localVariables( local!save : 2, { a!radioButtonField( label: "Is user ?", choiceLabels: {"User","Admin"}, choiceValues: {1,2}, value: local!save, saveInto: local!save, choiceStyle: "CARDS", ), a!gridField( label: "Read-only Grid", labelPosition: "ABOVE", data: 'recordType!{f55afdcb-53bf-4764-9d6b-79d1e1490735}PSB Details', columns: { a!gridColumn( label: "Id", sortField: 'recordType!{f55afdcb-53bf-4764-9d6b-79d1e1490735}PSB Details.fields.{c0258c07-713f-4c0f-8fed-f85fa4aaea65}id', value: fv!row[ 'recordType!{f55afdcb-53bf-4764-9d6b-79d1e1490735}PSB Details.fields.{c0258c07-713f-4c0f-8fed-f85fa4aaea65}id'], showWhen: local!save = 2 ), a!gridColumn( label: "Name", sortField: 'recordType!{f55afdcb-53bf-4764-9d6b-79d1e1490735}PSB Details.fields.{a9d0f67a-cba2-4fda-bc8f-3dc112496562}firstName', value: fv!row[ 'recordType!{f55afdcb-53bf-4764-9d6b-79d1e1490735}PSB Details.fields.{a9d0f67a-cba2-4fda-bc8f-3dc112496562}firstName'], align: "START" ), } ) } )