Subject | Re: [IBO] incremental search on multiple column sort |
---|---|
Author | Rick Roen |
Post date | 2004-12-05T14:38:28Z |
Thanks Helen,
That does clarify some information about how to setup the ordering
information in the query, however I still do not have results like
what I expect.
Regardless of how I order the result set, I cannot "find" anything
with a NON_SEED_ITEM = 1.
I have this for the OrderingItems now:
ITEMNAME=NON_SEED_ITEM,ITEMNAME;NON_SEED_ITEM DESC,ITEMNAME
with OrderingItemNo=-1 the NON_SEED_ITEMS are sorted first like I
expect, but in the IB_LISTBOX the row never moves when I type in
search. Using my results from below for example: when I type
in "Ba" nothing is found. I expect the row would move to "Bag".
When I use OrderingItemNo=1, the results are again sorted like I
expect AND I can find "Tom" for Tomato, but I can find nothing when
I type in "Bag".
Do I need to set something that tells the control that I ONLY want
to search in the ITEMNAME field for the incremental search.
I've set the search to be case insensitive, so that's not an issue.
TIA Rick
That does clarify some information about how to setup the ordering
information in the query, however I still do not have results like
what I expect.
Regardless of how I order the result set, I cannot "find" anything
with a NON_SEED_ITEM = 1.
I have this for the OrderingItems now:
ITEMNAME=NON_SEED_ITEM,ITEMNAME;NON_SEED_ITEM DESC,ITEMNAME
with OrderingItemNo=-1 the NON_SEED_ITEMS are sorted first like I
expect, but in the IB_LISTBOX the row never moves when I type in
search. Using my results from below for example: when I type
in "Ba" nothing is found. I expect the row would move to "Bag".
When I use OrderingItemNo=1, the results are again sorted like I
expect AND I can find "Tom" for Tomato, but I can find nothing when
I type in "Bag".
Do I need to set something that tells the control that I ONLY want
to search in the ITEMNAME field for the incremental search.
I've set the search to be case insensitive, so that's not an issue.
TIA Rick
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
> At 09:35 PM 4/12/2004 +0000, you wrote:
>
>
> >Delphi D7
> >IB_LookupList populated by an IB_Query
> >
> >I am unable to search properly when I sort on multiple columns...
> >
> >The SQL is:
> >
> >SELECT ITEMNUM
> > , ITEMNAME
> > , PRICE
> > , NON_SEED_ITEM
> >FROM ITEMS
> >
> >The Ordering Items information is:
> >
> >ITEMNAME=NON_SEED_ITEM,ITEMNAME
> >
> >The Ordering Links is:
> >
> >ITEMNAME=ITEM=1
> >
> >My result rows are something like this:
> >
> >123 Basil 0
> >456 Tomato 0
> >789 Watermelon 0
> >012 Pallet 1
> >013 Bag 1
> >
> >This puts all the "Non-Seed" items at the bottom of the list.
> >
> >When I do an incremental search in the Listbox, it works fine for
> >all items with a "NON_SEED_ITEM" = 0, but I get nothing on the
items
> >for "NON_SEED_ITEM" = 1.
> >
> >Is there any way to tell the search to ONLY look in ITEMNAME
field?
>
> Make the ITEMNAME the first element in the ORDER BY criterion.
But then
> you lose the ordering you wanted: to have the items in "seed"
order.
>
> What you really want (I think!!) is to provide a reversible search
order,
> so that you can flip the search to look for the higher-
numbered "seed" flag
> first. That's very easy in this case, where you have only two
possible
> values:
>
> OrderingItems:
>
> ITEMNAME=NON_SEED_ITEM,ITEMNAME;NON_SEED_ITEM,ITEMNAME DESC
>
> Now, when you click the ordering button on the column, the order
will
> toggle to having the "1" items first.
>
> If you want the descending order to be the default order, set
Ordering
> Links to :
>
> ITEMNAME=ITEM=-1
>
> But note, also, if you want to enable a run-time ordering by
ItemName alone
> (and disregard its Seed setting), just add another OrderingItem to
the
> array (the property is a stringlist):
>
> NAMEONLY=ITEMNAME;ITEMNAME DESC
>
> and OrderingLinks to:
> NAMEONLY=ITEM=2 (or -2, if you want the default to be descending).
>
> Helen