PxPlus User Forum

Twitter Twitter Twitter

Author Topic: grid help fill up  (Read 899 times)

eldonfsr

  • Silver Member
  • ***
  • Posts: 39
    • View Profile
grid help fill up
« on: January 11, 2021, 07:37:50 PM »
Hello I started with PVX no many samples can find or see, is hard get a progress when you have some examples or tutorial

I working on small app i need to show and fill a grid with information , hope some body can help me just when select the form filter records and show in the grid.

screen attach image

00010 ! detalleforma.en --- Created on Thursday, December 31 2020 by enrique
00020 !
00030 !
00070 PROCESS_FORMANAME:
00071 READ (1,KEY=FORMNAME$,DOM=BADID)FORMNAME$,DESCRIPTION$
00072 LET REFRESH_FLG=1; RETURN
00090 BADID:
00100 MSGBOX "Form not registered"
00110 RETURN
00120 !
00130 PREDISPLAY_FORMDETALLE:
00140 OPEN (1,IOL=*)"Formasdatas"
00141 OPEN (2,IOL=*)"detformas"
00150 RETURN
00160 !
00170 CELL_CHANGE_GRID_DETAILFORMCFIELDNAMER0:
00171 READ (2,KEY=FORMNAME$:FIELDNAME$,DOM=BADIDF)FORMNAME$,FIELDNME$
00172 MSGBOX "FIELD DEFINED"
00180 RETURN
00190 BADIDF:
00200 RETURN
00210 !
00220 PROCESS_BUTTON_ADDROW:
00221 LET FIELDNAME$="DATE INVOICE"
00222 LET ID=1
00223 LET FIELDLINE=10
00224 LET FIELDLENGTH=11
00225 LET ISDETAIL$="N"
00226 WRITE (2)FORMNAME$,FIELDNAME$,FIELDLINE,FIELDLENGTH,ISDETAIL$
00230 RETURN


Thanks
Enrique Pineda

Peter.Higgins

  • Diamond Member
  • *****
  • Posts: 124
    • View Profile
Re: grid help fill up
« Reply #1 on: January 14, 2021, 02:41:55 PM »
Enrique,

Grid are difficult, but a few concepts really help reduce the information overload.

The cell clicked on is not the row/column that will be updated.  row/column must changed to that location.

Row properties are numeric, but columns can be the column number, or the variable name. Variable names are more better as columns can be rearranged easily. 

Each grid method in windx goes out to the client and then back.  Get to know the "Pseudo Multi-Properties" or "Multi-Property Access" techniques to do as many of the changes in one shot.  These are usually pretty common so I use a grid utility object to process the majority of these.

Treat each line as a record rather than dealing with cells individually.  This is much simpler, just like we don't deal with just fields in file records.  See Load/Access by Row Grid Properties.  When the columns are rearranged, this keeps your head from exploding.

Grid Formats can be both set and obtained in the program so one grid can work with any file.  This is how I do logging displays.  I use the dictionary objects to build format strings, but the IOLists can be parsed, or Format strings for each put in the program, etc.  I would encourage you to learn this over using the nomads entry. It makes programs with grids much easier to reuse.   If a column should be hidden, set the width to zero so the format and record iolist remains constant.

The grid commands simplify most of the work.  Putting the records into one string and then a grid write of the whole list is quick and easy. 

To compare original records to grid changes, use a memory file to copy the records to first, then compare memory record to row record for real changes.

Do formatting and colors after loading data.  It is much more efficient.