Hello,
I’ve a grid that works in phpgrid 2.6 but there are problems with phpgrid 2.8.
I’ve added the option tags: true in the select2 script so that one can add some free text in addition to the dropdown list values. In phpgrid 2.6 this works perfectly, in phpgrid 2.8 this customisation (and all other type of select2 options) are just ignored. I’ve checked the demo page to see if with phpgrid 2.8 the script is changed but nothing is changed.
$col = array();
$col[“title”] = “Group”;
$col[“name”] = “group”;
$col[“editable”] = true;
$col[“edittype”] = “select”;
$col[“editoptions”] = array(“value”=>’Admin:Admin;Quality control:Quality control;Customer care:Customer care;’);
$col[“editoptions”][“dataInit”] = “function(){ setTimeout(function(){ link_select2(‘{$col[“name”]}’); },200); }”;
$cols[] = $col;
<!– Dropdown Select2 –>
<script>
function link_select2(id)
{
$(‘select[name=’+id+’].editable, select[id=’+id+’]’).select2(
{
onSelect: function()
{
jQuery(this).trigger(‘change’);
},
tags: true
});
$(document).unbind(‘keypress’).unbind(‘keydown’);
$(‘select[name=’+id+’].editable, select[id=’+id+’]’).on(“select2:select”, function (evt) {
var element = evt.params.data.element;
var $element = $(element);
$element.detach();
$(this).append($element);
$(this).trigger(“change”);
});
}
</script>
<!– Dropdown Select2 –>
Hi,
Can you please share the screenshot of the both behaviors.
I’m getting same behavior in 2.6 and 2.8.
If you can do screen recording showing the issue, It would help.
https://www.screencastify.com/
One more thing, Please check if the jQuery library files included for select2 are of same version.
It may be possible that your previous may be using older version of select2 while latest uses a newer.