Closed desyashasyi closed 2 years ago
@desyashasyi Have you tried setting the destroy config to the set of datatables configuration:
$this->config = [];
$subjectData = array();
$subjects = Subject::where('program_id', Auth::user()->faculty->program_id)->get();
foreach ($subjects as $subject) {
$subjectData[] = [
$subject->code,
$subject->name,
$subject->credit,
$subject->semester,
null,
];
}
$this->config['data'] = $subjectData;
$this->config['destroy'] = true; // <= THIS ONE!
Since the page is not fully reload, I believe this option may be necessary...
@Shidersz, Thank you very much... I will try this way.
@Shidersz, I have implemented $this->config['destroy'] = true;
, however it is still disappear when I call to refresh page.
@desyashasyi Have you tried removing plugin including sentences from the component's view and move they to the parent view?
<div wire:ignore.self>
{{-- THESE SENTENCES SHOULD BE ON PARENT VIEW, NOT ON THE COMPONENT VIEW DEFINITION --}}
@section('plugins.Datatables', true)
@section('plugins.DatatablesPlugin', true)
@section('plugins.BsCustomFileInput', true)
...
</div>
Closed because no feedback, reopen in case you need more help...
This issue still persists. Is there a solution yet ?
I used Datatables adminLTE plugin to present table in Livewire component/view. However, the feature of Livewire allow refresh page without reload all page. Hence, I user $refresh or wire:poll. But this command made a problem, that is the table row disappear. How to solve the problem?
Here is My code;
Livewire Controller
Livewire View
View before $refresh or wire:poll
View using $refresh or wire:poll
Thank you