⚠ 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

GroceryCRUD and jQuery ColorPicker



yadul

yadul
  • profile picture
  • Member

Posted 09 March 2015 - 20:49 PM

Hello everybody, I'm trying to put a jQuery ColorPicker plugin into a add/edit form inside GroceryCRUD. No errors reported in console but the color selection dialog did not appear. Only some controls below the page footer. Nothing else.

 

My code:

 

The callback funtion to fill the color code...

 

function color_callback($value = '', $primary_key = null) {
        $result = '<input id="field-color" style="width:100px;" name="color" value="' . (($value) ? $value : '') . '" maxlength="7" type="text">';

        return $result;
    }
 

The script...

 

$(function () {
    $('#field-color').colorpicker({
        parts: 'draggable',
        showCloseButton: false,
        modal: true,
        showCancelButton: false,
        closeOnEscape: false
    });
});