I'm using datatables.net and its plugin Editor I'm having trouble when i edit a field.
in edit field i've got L& #0039;ALSACE instead of L'ALSACE
Instead of clean uft8 i've got an html encoded char.
What do i do wrong ?
Laravel is 6.5.0. MySQL db is utf8mb4, collation utf8mb4_unicode_ci; laravel database config file is well configured ('charset' =>'utf8mb4', 'collation' =>'utf8mb4_unicode_ci') Editor is version 1.9.2 Datatables is version 1.10.20 yajra/laravel-datatables-oracle v9.7.1
Laravel controler (ajax get Json Data)
public function getList()
{
$regie = Regie::select(['id','libelle','web'])
->where('typemedia_id', '=', 8)
->with('grouperegies');
return Datatables::make($regie)->toJson();
}
Laravel Blade (view) js part
var editor;
$(document).ready( function () {
editor = new $.fn.dataTable.Editor( {
ajax: '{{ url('regiepqr-list') }}',
table: '#laravel_datatable',
idSrc: 'id',
fields: [
{ label: 'id', name: 'id' },
{ label: 'libelle', name:'libelle'},
{ label: 'web', name:'web'}
]
} );
$('#laravel_datatable').on( 'click', 'tbody td:not(:first-child)', function (e) {
editor.inline( this );
} );
$('#laravel_datatable').DataTable({
processing: true,
serverSide: true,
responsive: true,
select: true,
dom: 'Bfrtip',
buttons: [
{ extend: 'create', editor: editor },
{ extend: 'edit', editor: editor },
{ extend: 'remove', editor: editor }
],
language: {"url": "https://cdn.datatables.net/plug-ins/1.10.20/i18n/French.json"},
ajax: "{{ url('regiepqr-list') }}",
columns: [
{ data: 'id' },
{ data: 'libelle'},
{ data: 'web' }
]
});
});
A dd( Datatables::make($regie)->toJson()) in my controler show me that data are already in html encode char. is it normal ?
Many thank's B.