⚠ 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

[SOLVED] image_crud: showing images in a popup



ufodisko

ufodisko
  • profile picture
  • Member

Posted 28 September 2012 - 12:11 PM

Hello everyone,I have 2 tables; properties and propertiesimagesproperties:- propertyID- propertyType- propertyLocationpropertiesimages- id- url- propertyID- priorityI have already installed Image Crud and made the relationship correctly with the properties' table. So now when I navigate to [b]/examples/example3/1[/b]I'll be able to upload photos for the property with ID=1, it works.
function example3(){ $image_crud = new image_CRUD(); $image_crud->set_primary_key_field('id'); $image_crud->set_url_field('url'); $image_crud->set_table('propertyimages') ->set_relation_field('propertyID') ->set_ordering_field('priority') ->set_image_path('assets/uploads'); $output = $image_crud->render(); $this->_example_output($output);}
Now what I want to do is to be able to add an "Images" button next to "Add" and "Delete" under the "Actions" columnand when that button is clicked a popup will appear showing the images related to that propertyID.Anyway I can do that?

ufodisko

ufodisko
  • profile picture
  • Member

Posted 28 September 2012 - 13:15 PM

I think I solved it, and it was really easy.

I kept Image_Crud functions in a separate file and I just added this line to the main grid page.

$crud->add_action('Photos', '../../assets/images/photos.png', 'photos/photoID','ui-icon-plus');


It works. Now all I have to do is make it popup instead of opening in a new page.

K.B.

K.B.
  • profile picture
  • Member

Posted 02 October 2012 - 01:21 AM

This is what I did , used fancybox..since it should be included already..


[php]$crud->set_css('assets/image_crud/css/jquery.fancybox-1.3.4.css');
$crud->set_js('assets/grocery_crud/js/jquery-1.8.1.min.js');
$crud->set_js('assets/image_crud/js/jquery.fancybox-1.3.4.pack.js');
$output = $crud->render();[/php]

and add the classes or your fancybox selectors into the view header or external file..

Seems to work. but I need to debug some failed uploads..