Jump to content

[SOLVED] Using set_relation with callback_column problem

  • Please log in to reply
4 replies to this topic

#1 HumbleMonk



  • Members
  • PipPip
  • 25 posts

Posted 22 April 2012 - 07:15 AM

One of my table columns is a relation with another table so I used set_relation. It worked quite nicely, showing the fields from the other table that I wanted to show and presenting a dropdown in the add/edit views.

However, I realized that I need to give cells of that column a special class (so that I can perform some javascript on hover). To do this I can use callback_column easily. But I can't use callback_column and set_relation together - set_relation overrides callback_column.

As far as the basic table goes this isn't a huge deal - I can replicate the set_relation effect by just doing my own db->get_where. But what I am really missing out on is the dropdown list in the add/edit views that set_relation creates.

So, is there any way to keep set_relation for add/edit and do my own custom callback for the main table? Alternatively, is there any way to apply a class/id to a table cell while using set_relation?

#2 web-johnny


    grocery CRUD Author

  • Administrators
  • 1,144 posts
  • LocationLondon

Posted 22 April 2012 - 09:20 AM

Yes this is a known bug and sorry that I didn't have it into known issues. I will add it just now to be a reminder so I fix this for the next version .

Well good news, you can find a workaround for this at: http://www.grocerycr...indpost__p__982
Posted Image

#3 HumbleMonk



  • Members
  • PipPip
  • 25 posts

Posted 22 April 2012 - 03:06 PM

Wow, that actually worked!

I won't pretend to have a clue what it's doing but I'm just happy that it's working now :D

#4 vladbutterfly



  • Members
  • PipPip
  • 16 posts

Posted 28 April 2013 - 10:07 AM

Hi HumbleMonk

Could you please post the solution of your issue ???

I have the same prob and Im really begginer

I really need to have a small idea about this function


#5 goFrendiAsgard


    Advanced Member

  • Members
  • PipPipPip
  • 137 posts

Posted 18 May 2013 - 03:20 AM

I think the solution has already mentioned: http://www.grocerycr...urned/#entry982

No-CMS homepage : http://www.getnocms.com
No-CMS forum : http://www.getnocms.com/forum
No-CMS Github page : https://github.com/g...diAsgard/No-CMS


Please don't mix up No-CMS and groceryCRUD issues.
(eg: user authentication etc is No-CMS specific issue and has nothing to do with groceryCRUD)


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users