⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

how to custom the Actions column for each row differently ?



leeeastwood
  • profile picture
  • Member

Posted 12 June 2012 - 10:18 AM

hi,all
i am a new bee for grocery crud, it is really a good tools for CI.

here is my question:

i have used add_actions to add two actions: "submit" and "details", the code works well.
now, i want to disable "submit" button and "delete" button, if this row has already been submitted.
and disable "details" button when the userID is some special value.

so, can i change the actions column based on the field value of a row?
is there any callback function i can use? or where should i add the new codes in the core file

thanks in advance.

PS: I tried the callback_column('list_actions', callbak_function), it does not work .

best regards.
leeeastwood

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 12 June 2012 - 23:13 PM

I am sorry to tell you that this is a feature that it is not included yet in grocery CRUD. This a method that I will name it [i]callback_action[/i] and it will have a callback that you can add your own custom action. I will probably begin this and have it ready as for 1.2.4 version but as always without promising anything.

For now I am suggesting to use JavaScript for this kind of problem. You can take a look at this post to see an example of how to do it. I am suggesting to first be more familiar with grocery CRUD to use this kind of hacks. My suggestion is to use grocery CRUD for all your backoffice system just to tested and then come back and try this as it is a bit more complicated.

leeeastwood
  • profile picture
  • Member

Posted 13 June 2012 - 02:09 AM

many thanks, i will study your example.