Conditionally generate add dialog

QuestionsConditionally generate add dialog
Jeremy asked 8 years ago

So far this grid has been easy to use and very powerful.

I have a relational db setup, so for example, contacts and organizations. The contact table has an organization_id field and I was able to very easily make that show as a combo-box displaying the organization.name field.

But now I want to go a step further. I have set the first entry for organization, id=0 and name = "Create New". So if the user selects this "fake" organization, I want to immediately generate an Add dialog so they can type in the fields for the new organization. Once they "save" on that dialog, the newly generated (auto-incremented by db) organization_id should be saved to that contact row.

I've been looking thru all of the conditional examples and I'm not really seeing a way to use the built-in functionality to achieve this – at least not without a whole lot of complexity with js and lots of back/forth callbacks. But I figured I would check to see if there was some relatively straight-forward way to do this before I started going in to expand the source of the dbgrid itself to implement this.

Thanks!

4 Answers
Abu Ghufran answered 8 years ago

No perfect pre-built solution yet.

I am working on a demo for you that will need minimal work.
http://prntscr.com/cnuy1v

On +, it will open a fancy box (iframe page) and on close fancybox it will reload the entries.

Jeremy answered 8 years ago

Oh – Excellent.

*Definitely* getting my money's worth out of this product. Looking forward to the demo. I might actually be on schedule for this project 🙂

Thank you!

Jeremy answered 8 years ago

Hello –

Just checking to see if there's updates to the demo. Thanks!

Abu Ghufran Staff answered 5 years ago

Just to log a missing update, solution to this query is provided in following ticket:

https://www.gridphp.com/support/questions/custom-add-for-the-dependent-drop-down/

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

7 + 20 =

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?