⚠ 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 forum is read-only and soon will be archived. ⚠


Katherine

Member Since 03 Aug 2013
Offline Last Active Jun 03 2014 07:00 AM
-----

Topics I've Started

Set the allowed file types in upload field

06 January 2014 - 06:36 AM

My question is similar to this one http://www.grocerycr...or-file-upload/

 

The answer there is no longer updated. With the version 1.4, could the file types be set directly from the function? Something like this one:

$crud->set_upload_file_types('jpg','apk');

Thanks


Proper return for Callback_field of upload fields

17 November 2013 - 11:47 AM

How to properly return the fields of an upload field that had been set using the set_field_upload function. In the case of input fields, i could simply return them from the callback this way.

function price_callback($value)
        {
            return '<input type="text"  value="'.$value.'" name="price" style="width:462px"> 
                <br> <b>Example:</b>
                <br> <i>20,657, 1.45M</i>';
        }

I need to put a note beside the upload button


Image Crud set_ordering_field

28 August 2013 - 08:41 PM

The capability of image crud to have an ordering field is good. It updates the assigned column that is for ordering after images had been moved and reordered. But this doesn't update this field if images are newly uploaded and remained unmoved. 

 

Is it possible to set it this way? that if ever the user didn't reorder the images after upload, the first photo will be set as priority 1 and so on?


Is there a callback when an add had been cancelled?

10 August 2013 - 02:03 PM

I mixed grocery crud and image crud. In my grocery crud add form, theres an iframe pointing to the image crud.

 

In image crud everytime I upload, it automatically inserts to database with a temporary value in the foreign key column. Once submitted, this field will be updated base on the primary key id of the newly inserted data.

 

There will be an instance when the user will not submit the grocery crud form so the image that had been uploaded will be left in the database without being used.

 

So I plan to put a callback when the cancel button had been clicked and this will delete those inserted photos in the database.

 

Is it possible?


How to access the session variables from the add.php in grocery crud?

10 August 2013 - 11:49 AM

I modified the add.php in grocery crud and add an iframe that shows the image crud. Now i need to add a conditional statement so that this iframe will show for some specific tables only. I set a flag in the controller for this. And my problem now is I dont know how will i access this session because

$this->session->userdata('isUploadVisible');

will generate an error

Severity: Notice

Message: Undefined property: Grocery_CRUD::$session

Filename: views/add.php

Line Number: 2

This add.php is the one that can be found in

      assets/grocery_crud/themes/datatables/views/add.php