⚠ 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

Select with images



Sukys
  • profile picture
  • Member

Posted 29 March 2015 - 03:51 AM

Hello, guys!

 

I am new with Grocery Crud and Image Crud and need some help...

I am working on a project and have a doubt.

I have 02 tables. One is "image" table, where I store the 'id' (pk), 'title' and 'file_name'.

The other one i store the news. in this table, i have the 'id' (pk), 'img_id', 'text' and 'date'.

 

I got to make the CRUD on the first table with image crud, no problems.

Now I want to make a gocery Crud with the second table, but instead show the 'img_id' I want to show the THUMB of the image from the first table. Got it?

 

So far I tryed a lot of examples, researches and tests, relations but I am stucked. The only way I see to solve this is without Grocery or Image CRUD, but will change all the styles...

 

Also from this first table, is it posible to add some persistance? I mean, if there is some news related to the image, I can not delete the news (or delete the image and all other news related to it.

 

Thanks in advance,

 

Luis

 


Amit Shah
  • profile picture
  • Member

Posted 29 March 2015 - 04:20 AM

Hi Luis,

 

If u wana show the image from the second table - it wont be a straight forward relation with which u will be able to solve it - u need to use a callback for the same. There u will have control to display the same.

 

Now for the persistance - thats in your hand. If you dont want the user to delete the news ... use callback delete  .. control a user deleting the news there. As for disabling news image from being deleted - use callback_edit_field - just display the image without having the feature of the abilty to delete / re-upload the image.