Question

Sort List(section) by field in object

Hi

Tell me how you can sort the registry by field, the field can be either integer or lookup.

I tried it in the viewModelConfig block

indicate

"attributes": {
"ItemsSorting": {
{
"direction": "asc",
"columnName": "MscPriorityInteger"
}
}



but there is no effect, what am I doing wrong? How to correctly formulate conditions for sorting.

Thank you

Like 0

Like

3 comments
Best reply

Шевчук Святослав,

 

this can be checked out of the box. For example this code is autogenerated in the viewModelConfigDiff for the data source of the new list added to the page:

 

"DataGrid_3t5aefx": {

                        "isCollection": true,

                        "modelConfig": {

                            "path": "DataGrid_3t5aefxDS",

                            "sortingConfig": {

                                "default": [

                                    {

                                        "direction": "asc",

                                        "columnName": "Number"

                                    }

                                ]

                            }

                        },

 

Changing columnName and direction here will also change it on the page after refresh. So your code above should be changed to the one I shared and should be inside the viewModelConfigDiff array of the schema to change the default sorting.

Hello, 

Let me share some articles to explain the Creatio app's filtering. In the example of code that you've posted there is no filtering.

Please check the next examples of filtering, it can be helpful for your business task:

https://community.creatio.com/questions/building-column-path-filter-rec…

https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platfor…

https://community.creatio.com/questions/sort-objects-server-side

Anhelina, But I'm not saying anything about filtering! I'm talking about Sorting and the new interface. I don’t see anything about the new interface in the articles you cited.

Шевчук Святослав,

 

this can be checked out of the box. For example this code is autogenerated in the viewModelConfigDiff for the data source of the new list added to the page:

 

"DataGrid_3t5aefx": {

                        "isCollection": true,

                        "modelConfig": {

                            "path": "DataGrid_3t5aefxDS",

                            "sortingConfig": {

                                "default": [

                                    {

                                        "direction": "asc",

                                        "columnName": "Number"

                                    }

                                ]

                            }

                        },

 

Changing columnName and direction here will also change it on the page after refresh. So your code above should be changed to the one I shared and should be inside the viewModelConfigDiff array of the schema to change the default sorting.

Show all comments