Grid Add Manipulation (Filter)

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
wincode2008
User
Posts: 117

Grid Add Manipulation (Filter)

Post by wincode2008 »

-Supposed to be that i have a look up field Student Name,

-John
-Peter
-Alex

On the first row of Grid Add, i choose John.

On the succeeding row, the choices must be

-Peter
-Alex

because i already chosed John.

How could i do that? I need your help


kirondedshem
User
Posts: 642

Post by kirondedshem »

  1. why dont you just show the grid add, with the first, second and third rows already set to
    john, peter,etc, so that the user does not have to set them and maybe mess up in the process:
    You can even limit and set the grid add rows to be the exact number of the names you need to be there
    check:http://www.hkvforums.com/viewtopic.php?f=4&t=40867
    on how to set it up depending on your table structure

  2. Alternatively You can use the new Grid_Inserting() to validate and compare names in all rows before submiting them for insertion. But i prefer the first option


wincode2008
User
Posts: 117

Post by wincode2008 »

Tnx for the kirondedshem,

I am referring to the list wherein the source if from the database tables.

If a selected a particular list, the selected list will not be shown on the succeeding row.


kirondedshem
User
Posts: 642

Post by kirondedshem »

by the time the grid add form loads it has already set the lookup settings for each of the rows

Since you dont know if the person will choose john or peter on the first row, you can not know how what to hide or not allow on the succedding row.
So I would use one of the two options

  1. use modal dialog add instead and allow a person to add one row at a time, that way you can set the lookup field for the next time he opens the add form to not allow any of the save names to be used or just use row inserting event to validate against existings student name records.
  2. you automatically set the Student names yourself on all the grid add rows, such that he can fill in the rest of the fields for only the names he is interested in, that way you can populate the grid add form with all available names and if a user doesn't have to work on all the names, then you can just NOT save the rows for which the Students names dont have any of the fields you are intererested in filled.

3(not recommended)
unless (USING JQUERY you find a way to customize all lookup settings for all Student Name fields on each row upon selection made on one of the Student Name filed on each of the rows, which is ALOT harder than it sounds). I can't help you much with this option


Post Reply