Skip to content

Commit

Permalink
Fix: #295
Browse files Browse the repository at this point in the history
  • Loading branch information
mkocansey committed Jul 21, 2024
1 parent 45b593a commit 5ac9e0f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions resources/views/components/table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
'selectable' => config('bladewind.table.selectable', false),
'checkable' => config('bladewind.table.checkable', false),
'transparent' => config('bladewind.table.transparent', false),
'selected_value' => null,
])
@php
// reset variables for Laravel 8 support
Expand Down Expand Up @@ -314,9 +315,21 @@ class="hidden stroke-2 rounded-md bg-primary-500 text-white check-icon !size-5 !
});
}
const checkSelected = (table, selectedValue) => {
let selectedValues = selectedValue.split(',');
dom_els(`${table}.selectable tr`).forEach((el) => {
const thisValue = el.getAttribute('data-id');
if (selectedValues.includes(thisValue)) {
el.click();
}
});
}
</script>
@endonce
<script>
addCheckboxesToTable('.bw-table.{{$name}}');
// select rows in selected_value
@if(!empty($selected_value)) checkSelected('.bw-table.{{$name}}', '{{$selected_value}}') @endif
</script>
@endif

0 comments on commit 5ac9e0f

Please sign in to comment.