DanielZambSB / Equipo-IA

0 stars 0 forks source link

Pagination feature for table listing inquirys #31

Closed DanielZambSB closed 4 months ago

DanielZambSB commented 4 months ago

Pagination Algorithms

Variables and Definitions Q

Functions

showPages(Q)

  1. tp := Math.ceil(I.length / ps)
  2. tgp := Math.ceil(tp / gps)
  3. r := tp % gps
  4. if direction > 0
    1. if j=tgp-1 and r > 0:
      1. offset := j*gps
      2. redraw remainder 0 <= k < r size widget P[offset+k]
      3. hide the rest of the buttons
      4. Page(Q)
    2. If i % gps == 0:
      1. j := j+1
      2. offset := j*gps
      3. Change to PG[j] and P[offset]
      4. redraw full widget 0<=i<3, P[offset+i]
      5. Page(Q)
  5. if direction < 0
    1. if i % gps = gps-1:
      1. j:=j-1
      2. offset := j*gps
      3. Change to PG[j] and P[offset]
      4. redraw full widget 0<=i<3, P[offset+i]
      5. Page(Q)

Page [Q]

  1. If i = 0 then
    1. Disable <
  2. If i = tp - 1
    1. Disable >
  3. Mark P[i] as current
  4. If > (P, i)
    1. i := i+1
    2. Change to P[i]
    3. Read I from [i*ps, (i+1)*ps)
    4. Redraw full inquiry list table
    5. Go to (3)
  5. If < (P, i)
    1. i := i-1
    2. Change to P[i]
    3. Read I from [i*ps, (i+1)*ps)
    4. Redraw full inquiry List table
    5. Go to (3)

Additional Notes

DanielZambSB commented 4 months ago

full pagination algorithm implemented, quedo ready esta vuelta!!!