PSWriteHTML icon indicating copy to clipboard operation
PSWriteHTML copied to clipboard

Filter on reload

Open kort3x opened this issue 6 years ago • 14 comments

On page reload, tables still get filtered but the search field is shown as empty.

Example:

Table filtered for "Acrobat" image

After reloading the page, the filter is still applied but the search field is empty image

Placing the cursor in the search field and hitting "backspace" clears the invisible filter

kort3x avatar Apr 15 '19 16:04 kort3x

Thanks for reporting. It seems to be a bug in DataTables. I'll investigate whether this can be addressed with some JS to clear this, if not I'll try to open bug report in DataTables.

PrzemyslawKlys avatar Apr 15 '19 16:04 PrzemyslawKlys

Hrmms, how are you using it?

Import-Module PSWriteHTML.psd1 -Force
Import-Module PSSharedGoods -Force

if ($null -eq $Process) {
    $Process = Get-Process | Select-Object -First 70
}

New-HTML -TitleText 'My title' -UseCssLinks:$true -UseJavaScriptLinks:$true -FilePath $PSScriptRoot\Example19.html -Verbose {
    New-HTMLContent -HeaderText 'Test1' {
        New-HTMLTable -DataTable $Process -PagingOptions @(50, 100, 150, 200) -Filtering -FilteringLocation Top {
            New-HTMLTableCondition -Name 'HandleCount' -Type number -Operator gt -Value 300 -BackgroundColor Yellow
            New-HTMLTableCondition -Name 'ID' -Type number -Operator gt -Value 16000 -BackgroundColor Green
            New-HTMLTableCondition -Name 'Name' -Type string -Operator eq -Value 'browser_broker' -BackgroundColor Gold -Row
        }
    }
} -ShowHTML

Can't reproduce it? I type anything in filters, press F5 and it simply reloads. Also which browser? I tested in Google Chrome.

PrzemyslawKlys avatar Apr 15 '19 20:04 PrzemyslawKlys

Ok, I see in Edge Chromium and Firefox this is what you describe. I'm using Chrome 75 and no such thing happens. Will try to find out why.

PrzemyslawKlys avatar Apr 15 '19 20:04 PrzemyslawKlys

I'm using chrome 73

kort3x avatar Apr 15 '19 20:04 kort3x

I have HTMLTabs in there, maybe that's the issue?

kort3x avatar Apr 15 '19 20:04 kort3x

Here is a gist. I am to stupid to format PS code in the comments

https://gist.github.com/kort3x/3fb8f260cfc6f7f2bacb43b65b3a38ec

kort3x avatar Apr 15 '19 20:04 kort3x

Nah, you can format code in comment by using 3x ``` at the begining and 3x at the end. https://help.github.com/en/articles/creating-and-highlighting-code-blocks

PrzemyslawKlys avatar Apr 15 '19 20:04 PrzemyslawKlys

3x you mean ;)

kort3x avatar Apr 15 '19 20:04 kort3x

Yes!

PrzemyslawKlys avatar Apr 15 '19 20:04 PrzemyslawKlys

New-HTML -TitleText 'Software' -UseCssLinks:$true -UseJavaScriptLinks:$true -FilePath C:\inetpub\wwwroot\reports\software\softwareoverview\softwareoverview.html {
  New-HTMLTab -TabName 'Licensed Software'  {
      New-HTMLContent {
          New-HTMLTable -DataTable ($licensedSoftware | Select-Object Name,Version,Publisher,Computername,InstallDate,Collected) -PagingOptions @(100, 200) -Filtering -FilteringLocation Top
      }
  }
  New-HTMLTab -TabName 'Freeware'  {
      New-HTMLContent {
          New-HTMLTable -DataTable ($freeSoftware  | Select-Object Name,Version,Publisher,Computername,InstallDate,Collected) -PagingOptions @(100, 200) -Filtering -FilteringLocation Top
      }
  }
}

kort3x avatar Apr 15 '19 20:04 kort3x

ah, that's better

kort3x avatar Apr 15 '19 20:04 kort3x

It seems I've fixed this error - at least I think so. Will be in next release. Feel free to reopen when needed.

PrzemyslawKlys avatar Jun 12 '19 17:06 PrzemyslawKlys

looking good - thanks!

kort3x avatar Jun 13 '19 22:06 kort3x

Hi, i see a very similar thing, (using 0.0.132 ver) When i use the '''New-HTMLTable''' '''-Filtering''' option, if you use any of those "per column" filters, upon page reload it will still be filtered until you touch that filter field ,do space and delete or similar.

Since this one seems to be marked as closed, shall i start a new thread for this?

image

tomerikko avatar Feb 24 '21 13:02 tomerikko