⚠ 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

Custom rows, multiple images upload



Sebastian Zapato Blanco

Sebastian Zapato Blanco
  • profile picture
  • Member

Posted 26 October 2014 - 17:01 PM

Hi,

first of all, I congratulate the devs because grocerycrud has saved me a lot of time. Great work!
The only thing I don't like is, there is not much transparency while rendering the tables. I haven't thought of a better way of doing it though.

 

Now I am developing a backend for a client. I have 2 tables: Business (name, email, address, etc.) and Products (name, keywords, pictures)

 

The first problem is, there is a boolean field (tiny int) in the Business table called "activated", so we can enable/disable a business from the back end. So I can add a custom action with GC to toggle this value. But if I wanted o show a green image when the business is enabled, and a red image when it is disabled, how can I do that?

 

The second problem is, the products can have multiple images... what would be the simplest way to do that with GC? I can create a custom action, say "update pics" and then create a controller myself. But if I wanted to show a thumb of the images in the GC generated tables, how should I proceed?

 

Thank you in advance and all the best from Chile 

 

 


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 26 October 2014 - 20:13 PM

Hi there,

 

Welcome to the GC club.

 

First of all.. for your first problem, there aint much solution directly available in the add_action method. For that, it is recommended, you set an extra column and put a callback to generate the the relevant button / action, etc .. for the same

 

Secondly, for your second situation, i will recommend you search up the forum for solution .. you will find quite a number of solutions for the same like this one

 

/topic/2707-a-multi-multiupload/

 

Happy GCing