Default sorting for dynamic list

Understanding basics of 1C:Enterprise platform. To start working with 1C:Enterprise platform visit Getting started page

#1
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Oct 29, 2012
Company:

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

 
#2
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Nov 1, 2011
Company:

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

 
#3
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Oct 29, 2012
Company:

Thank you, Alexey!

 
#4
People who like this:0Yes/0No
Active user
Rating: 5
Joined: Jun 4, 2013
Company:

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 ...

 
#5
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

Can you show us your script?

 
#6
People who like this:0Yes/0No
Active user
Rating: 5
Joined: Jun 4, 2013
Company:

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 :)

Edited: mohammad maleh - Oct 28, 2013 01:10 AM
 
#7
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Nov 1, 2011
Company:

Try to set Index property of the field

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.