A
A
Ainur Valiev2019-05-15 08:18:45
1C-Bitrix
Ainur Valiev, 2019-05-15 08:18:45

How to sort by your property in the Bitrix admin panel in the list of orders?

There is a good material How to add your own filter in the list of orders in the admin panel . But there is no code there on how to add your own sorting by this field.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
eternalfire, 2019-05-15
@eternalfire

Hey! Can it be like this
$getListParams['order']['ID'] = 'asc';

S
Sly_tom_cat ., 2017-05-05
@Iqv

Without a set of tests - do not understand which ones do not pass.
By the way, in order not to count the number of iterations, you can use a set for the accumulator of details that need to be done, and at the end of the algorithm, simply count the number of elements in this set.
Yes, and in a loop - if you go through the elements of the list, then you do not need to go through the indices, and then get the element by index. It is easier to loop over the list itself, then you will immediately have elements in the loop variable.
Here is my version of your algorithm (with the changes mentioned above):

#!/usr/bin/env python3

def do(n):
    tot.add(n)
    for i in arr[n-1]:
        if i not in tot:
            do(i)


tot = set()
arr = []
for i in range(int(input())):
    arr.append(list(map(int,input().split())))
do(1)
print(len(tot))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question