Problem in grid with control combo

Moderator: Rathinagiri

Post Reply
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Problem in grid with control combo

Post by luisvasquezcl »

English By Google
Hello friends
In an editable grid with a ComboBox that contains the following information:
aItems_combo: = {'A', 'B', 'C', 'D'}
aClaves_combo: = {3, 1, 4, 2}
aItems_grid: = {{1}, {3}, {4}}

Control definition in grid
{{'COMBOBOX' aItems_combo, aClaves_combo}}

When data does show incorrectly, to edit the cell displays the content correctly.
According to previous data, the first data of the items the grid is 1, therefore, should show the letter B as defined aClaves_Combo delivered, however sample A.
I hope you can correct this problem.
Best regards,
Luis Vasquez

Hola amigos
En un grid editable con un control combobox que contiene los siguientes datos :

aItems_combo:= {'A','B','C','D'}
aClaves_combo := { 3, 1, 4, 2 }

aItems_grid :={ {1}, {3}, {4} }

{ { 'COMBOBOX', aItems_combo, aClaves_combo} }

Al mostrar los datos lo hace de forma incorrecta, al editar la celda muestra el contenido correctamente.

segùn los datos anteriores, el primer dato de los items del grid es 1, por lo tanto, deberìa mostrar la letra B segùn la definición entregada en aClaves_Combo, sin embargo muestra A.

Espero se pueda corregir este problema.
Saludos cordiales,
Attachments
test.zip
(1.6 KiB) Downloaded 224 times
Leopoldo Blancas
Posts: 388
Joined: Wed Nov 21, 2012 7:14 pm
Location: México

Re: Problem in grid with control combo

Post by Leopoldo Blancas »

Hola Luis...

Lo que pasa es que solo es un juego de posiciones de números... aClaves_Combo son los valores que va a regresar CUANDO SALGA DE EDICIÒN , entonces cuando editas... salen los números "correctos" y saliendo de edición te muestra el valor de retorno de a cuerdo a la posición de 'A', 'B', 'C' y 'D'.
ANALIZANDO TU EJEMPLO NO HAY ERROR. Si cambias el orden de los números de.... aClaves_Combo en orden....1,2,3,4. Todo sale como la lógica que estamos acostumbrados.
O que es lo que quieres hacer???
Saludos
Polo
*-----------------------------------------------------------------------------------------------------------
Hi Luis ...

What happens is that just a numbers game positions ... aClaves_Combo are the values ​​that will return when editing SALGA, so when you edit ... out the "correct" numbers and shows you edit out the return value in concordance with the position of 'A', 'B', 'C' and 'D'.
ANALYZING YOUR EXAMPLE NO ERROR. If you change the order of the numbers .... aClaves_Combo in order ....1,2,3,4. All logic goes as we are used to.
Or that's what you want to do??
regards
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Re: Problem in grid with control combo

Post by luisvasquezcl »

Hola Polo,
Ese demo corresponde a como se verìan los datos obtenidos desde una tabla ordenados por nombre.

Por ejemplo, si tu pides los datos a una tabla clientes ordenada por nombre no necesariamente el que comienza con A va a tener el id 1 sino el que le asigne la base de datos en el momento en que se registró, por eso es que en mi demo la letra A en el array aItems_combo tiene id 3 en el array aClaves_combo.

{ cControlType , acItems , axReturnValues }

Creo que deberìa tener en cuenta que cuando se le agrega el array axReturnValues a la definición de los controles del grid deberìa consultarlo antes de mostrar el valor de acItems; precisamente se agrega porque no tiene el orden convencional.

Espero haya aclarado un poco el tema.

Saludos cordiales,
Luis Vasquez

English By Google,
Hi Polo,
This demo is for such data would be obtained from a table sorted by name.For example, if you ask the customer data to a table not necessarily ordered by name that starts with A will have the id 1 but assigned to the database when you register, which is why in my demo letter A in the array has id 3 aItems_combo in aClaves_combo array.{CControlType, acItems, axReturnValues}
I think it should be noted that when added to the array axReturnValues
defining grid controls should consult before displaying the value added acItems precisely because it does not have the conventional order.
I hope I have clarified the issue somewhat.
Best regards,
Luis Vasquez
Post Reply