Grid columns from 2 table join, only want edit screen to update single table

QuestionsGrid columns from 2 table join, only want edit screen to update single table
Will D asked 2 years ago

I have a grid with columns from 2 tables using the $g->select_command..I’ve defined the $g->table = “table 1”. By default the edit screen tries to update table1 with all columns in the grid which will throw an error of course because the table 2 columns don’t exist in table 1 .   How do I suppress a column on the grid ( which isn’t in table 1) from the default update in the edit screen?  Is there an option I can set or do i need to use a custom function to replace the base functionality?

 

Thanks

3 Answers
Will answered 2 years ago

It never fails, break down and ask the question and you find the answer!
$col[“editable”] = false;

Abu Ghufran Staff answered 2 years ago

One option is to disable the edit property as you mentioned.

Another option is to use on_update callback function and write your own update logic in it, skipping the default grid update. You may have multiple updates in that code and other functions like emailing etc.

https://www.gridphp.com/docs/grid-events/

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Will D answered 2 years ago

Thanks,  I’ll look into that as well

Your Answer

18 + 5 =

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?