Hi, I want to know if ADD ACTION can set/change value on certain columns in my case, I want to set 'publish' column from 'article' table which has value 1 for public, 0 for private. I have idea to use callback, but I haven't know which one. Any idea? Thanks in advance!


Set value on add_action
#1
Posted 15 June 2015 - 10:35 AM
#2
Posted 15 June 2015 - 08:57 PM
So what is the problem?
Correct me if I am wrong:
You have each row with ADD_ACTION button, while clicking on it you need change some field of this row in database, for example set 0 or if it already 0 set to 1, right?
If so - create method in you controller for this ADD_ACTION where you get PRIMARY KEY of current row, then request to database to get this row interested you field, check it - if 0 then you should set 1, otherwise set 0.
After just redirect to the list (mean method where you adding add_action to the Grocery Crud).
#3
Posted 22 November 2015 - 09:37 PM
Paul,
"You have each row with ADD_ACTION button, while clicking on it you need change some field of this row in database, for example set 0 or if it already 0 set to 1, right?"
that is exactly what I need to do; i am new to grocery crud, can you give me a few lines about this method...
how to get request to DB?
how to write back new value?
how to redisplay the grid?
thanks,
aron
#4
Posted 23 November 2015 - 04:31 PM
LOL, sorry I cant post here simple staff about requesting DB, this is what u need to invistigate by yourself
Also tagged with one or more of these keywords: add_action, value, set, edit, action
Support →
I have a question →
CSRF Regenerate Not WorkingStarted by satheesh, 10 Dec 2019 ![]() |
|
![]() |
||
Support →
I have a question →
Add row from another tableStarted by SamArt, 03 Dec 2019 ![]() |
|
![]() |
||
Support →
I have a question →
"edit" button only in some rowsStarted by mdqseba, 06 Feb 2019 ![]() |
|
![]() |
||
Support →
I have a question →
Get ValuesStarted by nasrDev, 20 Jul 2018 ![]() |
|
![]() |
||
Support →
I have a question →
Changing DB-Column value on Read/ViewStarted by AlokNikhil, 10 Jul 2018 ![]() |
|
![]() |
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users