Desktop version

Main > Forum > 1C:Enterprise Platform > Studying 1C:Enterprise platform > Default sorting for dynamic list

Forum

Search UsersRules
Default sorting for dynamic list
#1
Active user
Points:: 0
Joined:: Oct 29, 2012

Hi, I need to set default sorting for one of catalogs by Order column, is it possible and how to do that?

Profile
#2
Active user
Points:: 0
Joined:: Nov 1, 2011

You can do it using script

Code
&AtClient
Procedure OnOpen(Cancel)
   
   Order = ThisForm.List.Order;
   Order.Items.Clear();
   OrderItem = Order.Items.Add(Type("DataCompositionOrderItem"));
   OrderItem.ViewMode = DataCompositionSettingsItemViewMode.Normal;
   OrderItem.OrderType = DataCompositionSortDirection.Asc;
   OrderItem.Field = New DataCompositionField("MyOrder");
   OrderItem.Use = True;
   
EndProcedure

Profile
#3
Active user
Points:: 0
Joined:: Oct 29, 2012

Thank you, Alexey!

Profile
#4
Active user
Points:: 0
Joined:: Jun 4, 2013

this script doesn't work for me ... is there any other trick to do it ? ... when i run it, it doesn't do anything at all

and thanks in advance for helping ...

Profile
#5
Guest
Points::
Joined::

Can you show us your script?

Profile
#6
Active user
Points:: 0
Joined:: Jun 4, 2013

Of course!!

In the list form:

Code
&AtClient
Procedure OnOpen(Cancel)      
   
   Order = ThisForm.List.Order;
   Order.Items.Clear();
   OrderItem = Order.Items.Add(Type("DataCompositionOrderItem"));
   OrderItem.ViewMode = DataCompositionSettingsItemViewMode.Normal;
   OrderItem.OrderType = DataCompositionSortDirection.Asc;
   OrderItem.Field = New DataCompositionField("Personel");
   OrderItem.Use = True;
      
EndProcedure


Personeln is the filed that i want the rows to be ordered according to

Hope you can help someway me guys :)

Profile
#7
Active user
Points:: 0
Joined:: Nov 1, 2011

Try to set Index property of the field

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.