FOROS PROFESIONALES
WINDEV
,
WEBDEV
y
WINDEV Mobile
Inicio
|
Mensajes recientes
|
Conéctese...
|
Desconectar
|
Español
Inicio
→
WEBDEV 2024
→
UI Code for record sequencing (moving records up and down in a list)
UI Code for record sequencing (moving records up and down in a list)
Iniciado por Gavin Webb, 08,jul. 2013 08:35 - 2 respuestas
Conéctese…
Gavin Webb
#1
Miembro registrado
6 mensajes
Publicado el 08,julio 2013 - 08:35
Anyone know of any code examples or help as to how best to implement record sequencing i.e. I have a simple reference\lookup table - just a string, but I want my users to be able to order them i.e. not alphabetical order - of course I know I need a sequence field and key - but how best to handle the UI for moving the records up and down......
Informar
0
0
Fabrice Harari
#2
Publicado el 08,julio 2013 - 14:48
Hi Gavin
this is how I do this:
- the sequencing field is a NUMERIC (not an integer, a HIGH precision
numeric
- when adding a line at the end, the field value gets biggest value+1
- Two buttons in the UI, UP and down
- when pressing Up on line 12 (by example), the sequencing value "S12"
becomes (S11-S10)/2. ie: the new value is set at the "MIDDLE" between
previous and previous-1... This is where the fact that we are using high
precision numeric become invaluable: there is only ONE hmodify to do.
- When pressing DOWN on line 9 (by example, the sequencing value "S9"
becomes (S11-S10)/2 (IF these 2 lines exist), or S10+1 if line 10 is the
last line
Best regards
--
Fabrice Harari
Consultant WinDev, WebDev et WinDev Mobile International
Nouveau site web (EXPERIMENTAL)
http://www.fabriceharari.eu
(Plus d'information sur
http://fabriceharari.com/index_FR.html
)
On 7/8/2013 12:35 AM, Gavin Webb wrote:
Anyone know of any code examples or help as to how best to implement
record sequencing i.e. I have a simple reference\lookup table - just a
string, but I want my users to be able to order them i.e. not
alphabetical order - of course I know I need a sequence field and key -
but how best to handle the UI for moving the records up and down......
Informar
0
0
Gavin Webb
#3
Miembro registrado
6 mensajes
Publicado el 08,julio 2013 - 15:09
Thanks, that's exactly what I thought too. Do you have a code example you could share with me to help me get along. I can read current record, I guess then it's a case of read previous record and note value, read previous value again and note value, then calc new value and modify original record and refresh the looper.
Tricky bit I guess is dealing with first and last records and defensive coding around trying to move first record up!
Informar
0
0
→ Volver a WEBDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versiones precedentes)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Búsqueda Tipo
Sólo temas
Todos los mensajes
Periodo Buscar
Cualquier fecha
Última hora
Última 24 horas
Última semana
Último mes
Último año
Cancelar
Vista previa del mensaje
Añadiendo una imagen
Importar una imagen desde una URL
Enviar una imagen desde un archivo de su disco
Arrastrar un archivo o click en "Examinar..."
o
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto