Skip to content

Conversation

@zsoch
Copy link

@zsoch zsoch commented Jul 24, 2020

Added new command New-HTMLTableColumnOption to configure some of the properties within columnDef within the HTML block of New-HTMLTable

Set all columns to hidden (-AllColumns must be used last) and show the first colum. This also doesn't impact conditional formatting.
New-TableColumnOption -ColumnIndex 0 -Hidden $false
New-TableColumnOption -AllColumns -Hidden $true

Set the first 3 columns to have smaller width and the 4th column to take up 100%
New-TableColumnOption -ColumnIndex (0..2) -Width 50
New-TableColumnOption -ColumnIndex 3 -Width "100%"

Only allow searching the first column
New-TableColumnOption -ColumnIndex 0 -Searchable $true
New-TableColumnOption -AllColumns -Searchable $false

Only allow columns 1, 3, 5 to be sortable
New-TableColumnOption -ColumnIndex 0,2,4 -Sortable $true
New-TableColumnOption -AllColumns -Sortable $false

See:
https://datatables.net/reference/option/columnDefs

Copy link
Member

@PrzemyslawKlys PrzemyslawKlys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks and works great. Couple of small fixes that I would like before approval. Thank you a lot for your contribution. It makes me feel that PSWriteHTML is getting somewhere when people submit their own PRs to it.

@PrzemyslawKlys PrzemyslawKlys merged commit c62e8c0 into EvotecIT:master Jul 27, 2020
PrzemyslawKlys added a commit that referenced this pull request Jul 27, 2020
@PrzemyslawKlys
Copy link
Member

I've formatted some code and fixed the $null side. Great work!

zsoch pushed a commit to zsoch/PSWriteHTML-1 that referenced this pull request Jul 28, 2020
zsoch added a commit to zsoch/PSWriteHTML-1 that referenced this pull request Jul 28, 2020
zsoch added a commit to zsoch/PSWriteHTML-1 that referenced this pull request Jul 28, 2020
* Revert "Update"

This reverts commit 3e79447.

* Revert "Update JustGate"

This reverts commit 1ef586d.

* Revert "Removed dead js code"

This reverts commit bc68d38.

* Revert "EvotecIT#138 small formatting fixes"

This reverts commit b49ee5f.

* Revert "Updated example to use psd1 file"

This reverts commit 60dbbfa.

* Revert "Reworked cmdlet, added additional documentation, optimized column definitions"

This reverts commit ddafb44.

* Revert "Add aliases for ordering"

This reverts commit f6915f9.

* Revert ""

This reverts commit 101004d.

* Revert ""

This reverts commit 1818c04.

* Revert ""

This reverts commit 119792a.

* Revert ""

This reverts commit 8f5c726.

* Revert ""

This reverts commit bd96ccf.

* Revert ""

This reverts commit c91d72f.

* Revert "fixed bug"

This reverts commit 38dfa21.

* Revert "add column option"

This reverts commit 455b7a7.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants