Фильтрация в t*dropdown*

Вопросы программирования и использования MSEide + MSEgui.

Модератор: Модераторы

mse
новенький
Сообщения: 68
Зарегистрирован: 08.08.2013 15:40:31

Сообщение mse »

git master 5d4f31da34547fe89f5983766ef4e7f291779286 has t*editlb.dropdown.options deo_livefilter (experimental).
An example is here:
http://gitorious.org/mseuniverse/mseuniverse/trees/master/attic/msedocumenting/mse/trunk/help/tutorials/db/lbdropdownfilter

Martin
Аватара пользователя
debi12345
долгожитель
Сообщения: 5761
Зарегистрирован: 10.05.2006 23:41:15
Откуда: Ташкент (Узбекистан)

Сообщение debi12345 »

can't get it working with the attached testcase
(on accessing the dropdown, PHYSINDEX in OnFilete is always "3")
Вложения
livefilter.rar
(5.22 КБ) 760 скачиваний
mse
новенький
Сообщения: 68
Зарегистрирован: 08.08.2013 15:40:31

Сообщение mse »

Код: Выделить всё

procedure tmainfo.filter(const sender: tcustomlookupbuffer;
               const physindex: Integer; var valid: Boolean);
begin
// valid:= sender.integervaluephys(physindex,0) > 1;
 valid:= sender.integervaluephys(0,physindex) > 1;
end;

BTW, deo_livefilter is useless with this filter because it does not depend on the entered text.

Posted after 1 hour 20 minutes 13 seconds:
git master 8e50a90e1af231f94c4bc75e6e90084a3839ba9b has an additional dropdown.delay property. Delay is in milliseconds and prevents the repeated list update while typing.
Аватара пользователя
debi12345
долгожитель
Сообщения: 5761
Зарегистрирован: 10.05.2006 23:41:15
Откуда: Ташкент (Узбекистан)

Сообщение debi12345 »

BTW, deo_livefilter is useless with this filter because it does not depend on the entered text.

Me know - it's just a stub code.
t-ea
новенький
Сообщения: 98
Зарегистрирован: 22.09.2006 00:22:34

Сообщение t-ea »

Фильтрация работает, НО…

1. Выбираем значение в списке (из приложенного примера, 'vvv'), <Enter> — устанавливается элемент 'vvvvvv'
2. Открываем dropdown-список и… выбранный элемент очищается. :!:


Хоть и не по теме топика, но в его развитие.

За что отвечает [olb_copyitems] в optionlb ?
Если не установить эту опцию (а у меня она сначала не была установлена), то при использовании фильтра не всегда правильно отображались данные в dropdown-списке.

P.S. Не сильно важно, но всё-таки, нельзя ли сделать чтобы dropdownrowcount подстраивалась под содержимое dropdown-списка?
Вложения
sample.png
sample.png (2.74 КБ) 11101 просмотр
mse
новенький
Сообщения: 68
Зарегистрирован: 08.08.2013 15:40:31

Сообщение mse »

Done, git master 64fd492c92e5be165e42332ef38d8d75e6c13298.
Normally proportional vertical scrollbar and thumbtrack is not possible with filtered datasets or lookupbuffers because the record count and "distance" between the items is unknown. odb_copyitems for t*dropdownlisteditdb loads a normal stringgrid with the filtered data, olb_copyitems for t*dropdownlisteditlb builds an index for the filtered datarows.
Currently there are artifacts with deo_livefilter without olb_copyitems.
Edit: Hopefully fixed in git master a858a4b9b6afca680ad24d9d54e807d15b468252.

Posted after 6 minutes 50 seconds:
1. Choose a value in the list (from the attached example, 'vvv'), <Enter> - is set element 'vvvvvv'
2. Open the dropdown-list and ... the selected item is cleared.

As designed, the selected value is the value of the first column, the filter searches in the second column. If one clicks on the dropdown button one probably don't want to start with the value of the first column as filter because the list will be empty. Press Esc in order to restore the previous value.

Posted after 22 hours 36 minutes 5 seconds:
git master 32eee9a24aa6b78d6533ec5756ca6346d6c0a2bd has a new onbeforefilter property, the example in MSEuniverse has been updated to demonstrate its use.
Ответить