Страница 2 из 2

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

СообщениеДобавлено: 23.08.2013 20:16:51
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

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

СообщениеДобавлено: 24.08.2013 01:24:06
debi12345
can't get it working with the attached testcase
(on accessing the dropdown, PHYSINDEX in OnFilete is always "3")

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

СообщениеДобавлено: 24.08.2013 09:09:42
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.

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

СообщениеДобавлено: 24.08.2013 10:58:42
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.

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

СообщениеДобавлено: 24.08.2013 11:16:13
t-ea
Фильтрация работает, НО…

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


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

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

P.S. Не сильно важно, но всё-таки, нельзя ли сделать чтобы dropdownrowcount подстраивалась под содержимое dropdown-списка?

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

СообщениеДобавлено: 24.08.2013 12:39:16
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.