PSWriteHTML icon indicating copy to clipboard operation
PSWriteHTML copied to clipboard

Modal details display for New-HTMLTable

Open PrzemyslawKlys opened this issue 6 years ago • 9 comments

Cool concept: https://datatables.net/extensions/responsive/examples/display-types/modal.html

Would be useful for having let's say basic details of Domain Controllers and display some additional information in a modal box. Wondering if it's possible to apply totally different HTML to that.

PrzemyslawKlys avatar Aug 08 '19 19:08 PrzemyslawKlys

I'm working on this and currently have it set to take the first row value but would like to add an option to select multiple values like 'Details for '+data[0]+' '+data[1] = 'Details for John Doe'.

modaltest

xlrod avatar Dec 05 '19 22:12 xlrod

I was thinking that this would be totally different information. The blue + already provides a lot of data. What I was thinking about is some way to attach additional data that is not available in the table. Not sure how thou :-)

PrzemyslawKlys avatar Dec 05 '19 22:12 PrzemyslawKlys

@xlrod do you think that would possible? Like to have additional HTML within details with a different source? Or are we bound to display only stuff from table (which still is cool)

PrzemyslawKlys avatar Dec 07 '19 09:12 PrzemyslawKlys

This is what I would like to try: Create a new [PSCustomObject] with a reference to the first object, like:

$Server = @()
$Server = [PSCustomObject] @{
    ServerName = "DC102"
    IPv4 = "10.0.0.1"
    DNS = "4.4.4.4"
}

$ServerDetails = @()
$ServerDetails = [PSCustomObject] @{
    ServerName = "DC102"
    Owner = "John Doe"
    Contact = "Support"
}

Add a parameter for the New-HTMLTable so the $ServerDetails only reference this table and not others with the same key value. Add a check to validate if there's a match between the data table and the reference object: If true, display the button, on click display the $ServerDetails in a modal box. Else hide the button.

Should I continue with this idea?

xlrod avatar Dec 07 '19 16:12 xlrod

You could try exploring it using idea from: https://github.com/EvotecIT/PSWriteHTML/tree/master/Examples/Example30-LinkedTable

However, I believe you would need to actually hardcode your table in HTML somewhere in invisible place. I am not sure how to approach this, but it would be cool concept.

PrzemyslawKlys avatar Dec 07 '19 16:12 PrzemyslawKlys

I also think having the Modal feature would be awesome! As well as simply being able to limit the displayed columns and have the rest of the data in the "expansion button" regardless if the screen is too small. For example for a data set of 5 Columns have a switch to display only X Columns and put the rest in the expansion button.

StewartPenTest avatar Jan 24 '20 22:01 StewartPenTest

You can already force display only 3 columns or 5 columns and force rest to be available ubder + button

PrzemyslawKlys avatar Jan 24 '20 22:01 PrzemyslawKlys

How? I've been messing around with the "Table" options but don't see a way

StewartPenTest avatar Jan 24 '20 22:01 StewartPenTest

Here is discussion about it with examples: https://github.com/EvotecIT/PSWriteHTML/issues/32

PrzemyslawKlys avatar Jan 24 '20 23:01 PrzemyslawKlys