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

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

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

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

Сообщение mse » 23.08.2013 20:16:51

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
mse
новенький
 
Сообщения: 68
Зарегистрирован: 08.08.2013 15:40:31

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

Сообщение debi12345 » 24.08.2013 01:24:06

can't get it working with the attached testcase
(on accessing the dropdown, PHYSINDEX in OnFilete is always "3")
Вложения
livefilter.rar
(5.22 КБ) Скачиваний: 622
Аватара пользователя
debi12345
долгожитель
 
Сообщения: 5752
Зарегистрирован: 10.05.2006 23:41:15
Откуда: Ташкент (Узбекистан)

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

Сообщение mse » 24.08.2013 09:09:42

Код: Выделить всё
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.
mse
новенький
 
Сообщения: 68
Зарегистрирован: 08.08.2013 15:40:31

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

Сообщение debi12345 » 24.08.2013 10:58:42

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.
Аватара пользователя
debi12345
долгожитель
 
Сообщения: 5752
Зарегистрирован: 10.05.2006 23:41:15
Откуда: Ташкент (Узбекистан)

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

Сообщение t-ea » 24.08.2013 11:16:13

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

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


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

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

P.S. Не сильно важно, но всё-таки, нельзя ли сделать чтобы dropdownrowcount подстраивалась под содержимое dropdown-списка?
Вложения
sample.png
sample.png (2.74 КБ) Просмотров: 9185
t-ea
новенький
 
Сообщения: 98
Зарегистрирован: 22.09.2006 00:22:34

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

Сообщение mse » 24.08.2013 12:39:16

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.
mse
новенький
 
Сообщения: 68
Зарегистрирован: 08.08.2013 15:40:31

Пред.

Вернуться в MSEide + MSEgui

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 3

Рейтинг@Mail.ru