need Help with oBro:bSeek

need Help with oBro:bSeek

Postby Jimmy » Tue Aug 15, 2023 1:24 pm

hi,

can somebody point me to working "increment" Seek :?:

Question :
a.) i guess it need an Index to SEEK. *CDX seems to be open "automatic" but *.NTX must be open before ?
b.) if *.CDX have TAGs, how to change TAG when click on Header of Column ?
c.) what about ADO ?
i saw
Code: Select all  Expand view
  oBrw:bSeek := { | c | oBrw:AdoIncrSeek( c ) }

can i use it on Recordset of Excel ?
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: need Help with oBro:bSeek

Postby karinha » Tue Aug 15, 2023 4:17 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: need Help with oBro:bSeek

Postby nageswaragunupudi » Wed Aug 16, 2023 4:59 am

can somebody point me to working "increment" Seek :?:


Incremental seek works automatically if the programmer does not do anything to disturb the automatic behavior of xbrowse.

Code: Select all  Expand view
XBROWSER "any.dbf" AUTOSORT

Start clicking on any header and the order is changed and incremental seek / filter work automatically

a.) i guess it need an Index to SEEK. *CDX seems to be open "automatic" but *.NTX must be open before ?

Yes.
In case of DBFNTX, after USE, open indexes by
Code: Select all  Expand view
SET INDEX TO .....

and it is ready.

b.) if *.CDX have TAGs, how to change TAG when click on Header of Column ?

XBrowse automatically does all this for us.
XBrowse searches all open indexes/tags and identifies which index/tag is to be used to sort on which column and stores the index/tag information in oCol:cSortOrder.
When the header is clicked, xbrowse automatically sets the index tag to oCol:cSortOrder, without disturbing the cuurent record pointer.

c.) what about ADO ?

Whether ADO or other sources like Mysql, postgre, etc. XBrowse derives the field name from the expression and stores the right information in oCol:cSortOrder. On header click, xbrowse uses this information to switch the sort order and it also knows depending on the datasource, how to change the sort order.

Better we leave all this to XBrowse.

can i use it on Recordset of Excel ?

Yes, you can. Clicking on header to sort the column and incremental seek/filter works just like any other datasource.


Inline Cell Edit:
Pressing Enter key starts inline cell edit, if the cell is editable.
[A reason why we should not disturb the internal behavior of XBrowse by assigning different actions to common keys using bKeyDown]
When FASTEDIT is true (oBrw:lFastEdit is .t.), pressing a permitted alpha numeric key starts inline cell edit, using that key as the first key of the Get.

Incremental Seek:

This is the default behavior of xbrowse unless we inhibit it by setting oBrw:lIncrSeek := .f.

if the data is sorted on any column and lFastEdit is not .t., pessing any key seeks the first row where the sorted column value begins with that character. Example, pressing "a" seeks value starting with "a" and again pressing "n" seeks "an" and so on.

If we set
oBrw:lSeekWild := .t.
Then xbrowse searches for entered value anywhere inside the field value.
if we set oBrw:lIncFilter, the entered keys are used to filter the data instead of seeking.


PS: Please do not disturb the internal behavior or xbrowse by using method keydown.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: need Help with oBro:bSeek

Postby Jimmy » Wed Aug 16, 2023 5:10 am

hi,

thx for all Information.

i have to read it which "Keyword" are used
( AUTOSORT, oCol;cSortOrder, oBrw:lIncrSeek, lFastEdit, oBrw:lSeekWild, oBrw:lIncFilter,)
and learn how to use it
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 56 guests