MedicOneSystems / MedicOneSystems/livewire-datatables
Reset fields button don't empty number filters
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.2k
- Forks
- 257
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
When clicking on "Reset fields" button, the number filters are deactivated but the fields are not emptied. I tried some stuff without success like overriding some methods :
` public function clearAllFilters()
{
parent::clearAllFilters();
$this->emit('resetFilters');
$this->resetPage();
}
public function resetFilters() {
//emptying all number filters
foreach($this->columns() as $col) {
$index = $this->getColumnIndexByName($col->name);
if($col instanceof NumberColumn && sizeof($this->activeNumberFilters[$index]) > 0) {
// howto empty filter number fields?
// $this->removeNumberFilter($index);
// $this->doNumberFilterStart($index, '');
// $this->doNumberFilterEnd($index, '');
}
}
}`
Any idea?
Thank a lot
Marion
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start from clearAllFilters(), resetFilters(), and the NumberColumn number-filter methods shown in the issue. Reproduce clicking “Reset fields” with active number filters, then verify that the number fields are emptied as well as deactivated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- laravel, php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100