ComboSearchGrid

HMG Samples and Enhancements

Moderator: Rathinagiri

User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: ComboSearchGrid

Post by Rathinagiri »

Sorry, I could not understand your problem. :(

Can you give in a sample code?

I am using either of the ComboSearchBox, ComboBoxAnywhereSearch, HMG_aChoice according to the customer's requirements.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
AidTIC
Posts: 117
Joined: Mon Apr 22, 2013 8:29 am
DBs Used: DBF
Contact:

Re: ComboSearchGrid

Post by AidTIC »

Hola,

Seria posible hacer la búsqueda desde una celda de un GRID?

La información de la tabla se carga cuando inicio el programa.

Gracias


Hello,

Would it be possible to search from a cell in a GRID?

The information in the table is loaded when I start the program.

Thank you


Image
Attachments
grid.jpg
grid.jpg (88.96 KiB) Viewed 4225 times
Skydone Solutions
www.skydone.com
EduardoLuis
Posts: 682
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina

Re: ComboSearchGrid

Post by EduardoLuis »

Hola AidTIC:

Anticipadamente, creo que no podés iniciar la busqueda desde el mismo grid.-
Cual es la finalidad ????
Si ella fuera es filtrar registros para que te muestre o exhiba solo los registros que contengan los parámetros que el usuario indique, el mejor camino es habilitar (p. ej. con un doubleclick) una rutina para que exhiba una ventana child en la que ingreses los parámetros; luego de confirmados actualizas el grid para que solo exhiba los registros que respondan a esos parámetros.- Yo lo uso de esa forma, y resulta eficiente.- Desde ya que uso un grid virtual porque es mas veloz, sobre todo si hay miles de registros.-
Si la finalidad es que el combo tenga mas opciones, deberías crear un array que se actualize con nuevas opciones que quiera el usuario.-
Espero te haya orientado en tu consulta.-
Eduardo
User avatar
AidTIC
Posts: 117
Joined: Mon Apr 22, 2013 8:29 am
DBs Used: DBF
Contact:

Re: ComboSearchGrid

Post by AidTIC »

Hola EduardoLuis,

Tengo un Grid donde voy anotando los servicios que realizo, y ha varia columna que me gustaria que al escribir el nombre del cliente (que tengo en una array {cod, nombre} me lo fuera mostrando.

Esa es la idea que quiero, se que podria abrir una ventana e implementar la funcion en ella, pero me gustaria que fuera mas limpia.

gracias

Hello EduardoLuis,

I have a Grid where I go noting down the services I do, and I have a column that I would like to write the name of the client (that I have in an array {cod, name}, showing it to me.

That's the idea I want, I know I could open a window and implement the function in it, but I'd like it to be cleaner.

Thank you
Skydone Solutions
www.skydone.com
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: ComboSearchGrid

Post by andyglezl »

AidTIC wrote: Wed Nov 14, 2018 5:32 pm Seria posible hacer la búsqueda desde una celda de un GRID?
*-----------------------------------------------------------------------------
Would it be possible to search from a cell in a GRID?
Tengo un Grid donde voy anotando los servicios que realizo, y ha varia columna que me gustaria
que al escribir el nombre del cliente (que tengo en una array {cod, nombre} me lo fuera mostrando.
*-----------------------------------------------------------------------------------------------------------------------------------------------------
I have a Grid where I go noting down the services I do, and I have a column that I would like
to write the name of the client (that I have in an array {cod, name}, showing it to me.

Hola AidTIC
No me queda clara tu pregunta.
En el Grid que muestras en la imagen no tienes ninguna columna para el Cliente.
Lo que pienso, es que deberias tener un ComboSearchBox (con tu array de Clientes) previo al Grid y ahí seleccionar y mostrar el Cliente.
( o a menos que lo que quieres es poner un nombre de Cliente diferente a cada linea del Grid)
*---------------------------------------------------------------------------------------------------------------------------------------
Hello AidTIC
Your question is not clear to me.
In the Grid that you show in the image you do not have any column for the Client.
What I think, is that you should have a ComboSearchBox (with your Clients array) before the Grid and then select and display the Client.
(or unless you want to put a different Client name on each line of the Grid)
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
AidTIC
Posts: 117
Joined: Mon Apr 22, 2013 8:29 am
DBs Used: DBF
Contact:

Re: ComboSearchGrid

Post by AidTIC »

Mi intención es en "ColumnControls" del "GRID", poder hacer la Busqueda array "aCuenta". Si que necesito ver las 2 columnas Cuenta y Descri, y poder buscar por cualquiera de los 2, tal y como lo hace "ComboSearchGrid"

My intention is in "ColumnControls" of the "GRID", to be able to do the Search array "aCuenta". If I need to see the 2 columns Account and Descri, and be able to search for any of the 2, as it does "ComboSearchGrid"

Code: Select all

 
 AbrirTablas('CuentaOn')
 CuentaOn->(DBGotop())
 aCuentas := {}
  WHILE  ! EOF()   
       IF CUE_SUBCUE > 0 
	    aHash    := hash()
	    aHash ["Cuenta" ]   := CUE_CUENTA + StrZero(CUE_SUBCUE,5)
	    aHash ["Descri"   ] := CUE_DESCRI                                                
	   AADD(aCuentas, aHash)
	EndIf  
	CuentaOn->(DBSkip())	
 ENDDO	
CerrarTablas ('CuentaOn')

Code: Select all

 
 @ 100 , 10 GRID Grid_TL         ;
	    	WIDTH	    1100     ;
                HEIGHT       370     ;
                HEADERS {    'Cuenta'    ,     'D/H'        ,   'Formula'    ,   'Concepto'   ,   'Documento'  }	 ;
		JUSTIFY { GRID_JTFY_LEFT , GRID_JTFY_CENTER , GRID_JTFY_LEFT , GRID_JTFY_LEFT , GRID_JTFY_LEFT }     ;
	        WIDTHS {       140       ,       40         ,      300       ,       300      ,       250      }	 ;
	        COLUMNCONTROLS { {'ComboSearchGrid',aCuenta} , , , , };
        	Value 1;
		EDIT ;
		CELLNAVIGATION;
	        ON INPLACEEDITEVENT ProcGridInplaceEditEvent()
     //           ON KEY ProcOnKeyEvent();
       //         ON CLICK ProcOnClickEvent()
Image
Attachments
skybclient.JPG
skybclient.JPG (92.91 KiB) Viewed 4027 times
Skydone Solutions
www.skydone.com
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: ComboSearchGrid

Post by andyglezl »

AidTIC:

Concuerdo con lo que dice Eduardo Luis, si especificamente quieres hacer
lo que comentas, creo que tendrías que desarrollarlo por tu cuenta.
( y luego nos lo compartes! ;) )

Lo que se me ocurre, es que puedes definir un Control ComboSearchGrid en modo HIDE
y con ON KEY ProcOnKeyEvent() lo muestras y seleccionas las Cuentas o Clientes según
sea el caso y el valor del ComboSearchGrid lo asignas a la celda del Grid en que estes
posicionado. Luego lo vuelves a poner HIDE.
+------------------------------------------------------------------------------------------------------------------
AidTIC:

I agree with what Eduardo Luis says, if you specifically want to do
What you are saying, I think you should develop it on your own.
(and then share it with us! ;) )

What I can think of, is that you can define a ComboSearchGrid Control in HIDE mode
and with ON KEY ProcOnKeyEvent () you show it and select the Accounts or Clients according to
be the case and the value of the ComboSearchGrid you assign to the Grid cell in which you are
positioned.Then you put it back on HIDE.
Andrés González López
Desde Guadalajara, Jalisco. México.
EduardoLuis
Posts: 682
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina

Re: ComboSearchGrid

Post by EduardoLuis »

Hola AidTIC

Fijate en el demo adjunto. Esa es la solución que implementé para hacer búsquedas complejas.
Eduardo
Attachments
VIRTUALGRIDMULTISEARCH.zip
(10.84 KiB) Downloaded 291 times
EduardoLuis
Posts: 682
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina

Re: ComboSearchGrid

Post by EduardoLuis »

Hi friends: i've forgot to publish in english.-

Hy Aidtic

Take a look to attached file. This is the solution i found for complex search.-
Once compiled. Press search button ( magnifying glass icon ) and enjoy.-
Columns can be sorted before or after search.-
Eduardo
User avatar
AidTIC
Posts: 117
Joined: Mon Apr 22, 2013 8:29 am
DBs Used: DBF
Contact:

Re: ComboSearchGrid

Post by AidTIC »

Tengo problemas con COMBOSEARCHGRID , he pueso 2 COMBOSEARCHGRID en la misma ventana, el primero cuando seleccionas un registro, rellena el formulario entero de la ventana, con SetProperty, pero unos de los datos que rellena es el valor del segundo COMBOSEARCHGRID , ejecuta la busqueda del segundo y al aceptar el valor(ENTER) se sale directamente si dar error .

Habria alguna forma de que al darle el valor al segundo COMBOSEARCHGRID no haga nada salvo que yo cambie el valor.


I have problems with COMBOSEARCHGRID, I have 2 COMBOSEARCHGRID in the same window, the first when you select a record, fill in the entire form of the window, with SetProperty, but one of the data that you fill is the value of the second COMBOSEARCHGRID, execute the search of the second and when accepting the value (ENTER) it goes directly if giving error.

There would be some way that by setting the value to the second COMBOSEARCHGRID, do nothing unless I change the value.

Code: Select all

SetProperty( cParentName, cTxBName   , "VALUE", cListItem )
SetProperty( cParentName, "tBanDes"    , "VALUE", cListBanDes )
SetProperty( cParentName, "NEMP"        , "VALUE", cListBanEmp )
SetProperty( cParentName, "tBanCue"    , "VALUE", cListBanCue )
Skydone Solutions
www.skydone.com
Post Reply