Dear Abu. There is some possibility in phpGrid to show the color palette as shown in the screenshot that I send you. The color field is inside my table.
Attach : https://imgur.com/a/eVWAfyQ
Hi,
For this and all other INPUT attributes, you can set them in editoptions. E.g.
$col = array();
$col[“title”] = “Client”;
$col[“name”] = “name”;
$col[“width”] = “100”;
$col[“editable”] = true;
$col[“editoptions”][“type”] = “color”;
$cols[] = $col;
Hello abu It helped me what you envy me, but the value does not save it in the table. What will be happening? Can you put a default color? Thank you
https://imgur.com/gallery/vxn0GIP
Hello,
I tested more on it and Instead of above, you can use following column setting:
$col = array();
$col[“title”] = “gender”;
$col[“name”] = “gender”;
$col[“editable”] = true;
$col[“width”] = 500;
$col[“editoptions”][“dataInit”] = “function(o){setTimeout(function(){
jQuery(o).parent().append(‘<input type=color />’);
jQuery(o).parent().find(‘input[type=color]’).change(function(){ o.value=this.value; });
jQuery(o).hide();
},200);}”;
$cols[] = $col;
The datainit event is called when textbox is shown. We appended a color input, connect the values on change event and hides the text input.
https://gist.github.com/gridphp/dc0399704cbfaa31f682896e4738eb64