Freedom UI - Sorting Lookup on List

Hello 

I have implemented lookup sorting on Accounts_FormPage like this:

https://community.creatio.com/questions/freedom-ui-sorting-lookup

for field 'Indutry' - It works great :)

 

I have also this filed also on Accounts_ListPage

 

HOW CAN I SET SORTING FOR LOOKUP FIELD ON LIST ?

 

changing field value on list calls "crt.HandleViewModelAttributeChangeRequest"

for "Items"   attribute , on what attribute shodl I set  _List_Sorting  ?

 

Like 1

Like

1 comments

Hi, you can do it on HandleViewModelAttributeChangeRequest like this 
if(request.AttributeName=="AccountGridDetail") {

  var AccountGridDetail = await request.$context.AccountGridDetail;

  AccountGridDetail?.forEach(item => {

    var sorting = item.attributes.AccountGridDetailDS_MYFIELDFORSORTING_List_Sorting;

        sorting[0].columnName = "MYSortingConfig";

        sorting[0].direction = "desc";

  });

}

Show all comments