Content of first field should work as filter for selection of second field

QuestionsContent of first field should work as filter for selection of second field
Rudolf Wagner asked 2 years ago

Hello,

I have another question: In a grid employees should enter their time entries. By adding a new record the first field is the selection of the client, the second field is the selection of the job. What I’m trying to achieve is that after the client is selected only the related jobs of this client will show as selection for the job field. This should happen without pushing a reload button or something else. Is this possible?

Kind regards, Rudolf

2 Answers
Abu Ghufran Staff answered 2 years ago

Please refer this sample code:

https://www.gridphp.com/demo/demos/appearance/dropdown-dependent.php

Code: https://www.gridphp.com/demo/demos/appearance/dropdown-dependent.phps 58-85

It loads ‘notes’ dropdown based on changing the ‘clients’ dropdown.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Rudolf Wagner answered 2 years ago

Hi Abu,

After playing around with your code example I can’t find a solution for my exact case. Please see screenshot attached: What I’m trying is that in the Add record modal, if you select a Client (Kunde) you can only choose from his particular jobs (Auftrag) in the second select box. And this should happen without reloading or pushing a button.

Applying your code I get to the point where in the select box Auftrag the list is correctly filtered, but the screen is flickering as if the page is reloading frequently. And I’m not able to select an entry. Can you please help, thanks.

View post on imgur.com

Abu Ghufran Staff replied 2 years ago

Please share your related grid code on gist.
https://gist.github.com/

To see the flickering issue, you can record a screencast and share link:
https://www.screencastify.com/

Your Answer

2 + 8 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?