EnhancedHTML2 MakeTableDynamic Not Working

Welcome Forums General PowerShell Q&A EnhancedHTML2 MakeTableDynamic Not Working

Viewing 10 reply threads
  • Author
    Posts
    • #224478
      Participant
      Topics: 36
      Replies: 59
      Points: 133
      Rank: Participant

      I am not able to get “MakeTableDynamic” parameter working. MakeHiddenSelection isn’t working either. My table looks fine for the most part, but these parameters aren’t working. Not sure if it’s Java-related, etc. I can’t seem to find prereqs anywhere. In chrome, it basically loses all styling for some reason. When I open in IE11, it is styled with the headers, etc., but the dynamic portion isn’t showing. Any suggestions?

      </p><p>body {</p><p>color:#333333;<br />font-family:Calibri,Tahoma;<br />font-size: 10pt;<br />}<br />h1 {<br />text-align:center;<br />}<br />h2 {<br />border-top:1px solid #666666;<br />}<br />th {<br />font-weight:bold;<br />color:#eeeeee;<br />background-color:#333333;<br />cursor:pointer;<br />}<br />.odd { background-color:#ffffff; }<br />.even { background-color:#dddddd; }</p><p>.paginate_enabled_next, .paginate_enabled_previous {<br />cursor:pointer;<br />border:1px solid #222222;<br />background-color:#dddddd;<br />padding:2px;<br />margin:4px;<br />border-radius:2px;<br />}<br />.paginate_disabled_previous, .paginate_disabled_next {<br />color:#666666;<br />cursor:pointer;<br />background-color:#dddddd;<br />padding:2px;<br />margin:4px;<br />border:radius:2px;<br />}<br />.dataTables_info { margin-bottom:4px; }<br />.sectionheader { cursor:pointer; }<br />.sectionheader:hover { color:red; }<br />.grid { width:100% }<br />.red {<br />color:red;<br />font-weight:bold;<br />}</p><p>

      </p><p>$Table = $Array | ConvertTo-EnhancedHTMLFragment -As Table -PreContent '</p><h1> Expirations </h1><p>' -MakeTableDynamic</p><p>ConvertTo-EnhancedHTML -HTMLFragments $Table -CssUri 'C:\Temp\CSSExample.css' | Out-File C:\Temp\Expirations.html</p><p>

      • This topic was modified 7 months, 1 week ago by Jeff.
      • This topic was modified 7 months, 1 week ago by Jeff.
    • #224496
      Participant
      Topics: 36
      Replies: 59
      Points: 133
      Rank: Participant

      I have even tried downloading jquery and the datatable and still not having any luck. Any suggestions? Seems like having this functionality will open up a lot of possiblities.

      new code with pointing to local files:

      </p><p>$Table = $Array | ConvertTo-EnhancedHTMLFragment -As Table -MakeTableDynamic<br />$params = @{'CssUri'='C:\Temp\CSSExample.css';<br />'Title'='Expirations';<br />'HTMLFragments'=$Table;<br />'jQueryDataTableUri'='C:\Temp\DataTables-1.10.20\js\jquery.dataTables.js';<br />'jQueryUri'='C:\Temp\jQuery-3.3.1\jquery-3.3.1.js'}</p><p>ConvertTo-EnhancedHTML @params | Out-File C:\Temp\Expirations.html</p><p>

    • #224499
      Participant
      Topics: 9
      Replies: 678
      Points: 2,683
      Helping Hand
      Rank: Community Hero

      By my calculations you’ve had the module about 3 hours? How long do you typically spend learning something new?

    • #224646
      Participant
      Topics: 36
      Replies: 59
      Points: 133
      Rank: Participant
      • By my calculations you’ve had the module about 3 hours? How long do you typically spend learning something new?

        Correct. I am following a pluralsight course. This portion appears to be straight forward. However, it is not working and believe it is something with Java/Js files. By default, it’s supposed to use the ones on the internet, which I have verified by looking at developer tools after viewing the HTML file. I have tried downloading the files as well and pointing to them locally and it’s still not working. Looking for some feedback as I have not gotten past this initial hurdle and wondering if it’s something configured in my browser or network policies. Would like to keep moving forward with the course.

    • #224667
      Participant
      Topics: 9
      Replies: 678
      Points: 2,683
      Helping Hand
      Rank: Community Hero

      Surely the course offers the code for download. Use the course example and move on? I’d definitely put in a reasonable amount of time trying to get it working before posting once for help, let alone twice. You’ve given no details, like what’s in your $table variable. I think you should keep trying for sure, but maybe start with something less finicky than HTML in powershell.

    • #224670
      Participant
      Topics: 36
      Replies: 59
      Points: 133
      Rank: Participant

      <p style=”text-align: left;”>

      Surely the course offers the code for download. Use the course example and move on? I’d definitely put in a reasonable amount of time trying to get it working before posting once for help, let alone twice. You’ve given no details, like what’s in your $table variable. I think you should keep trying for sure, but maybe start with something less finicky than HTML in powershell.

      Asking questions saves me from spending a day on random issues. I am using the course example. Using their exact CSS and code. Trying to get ideas from this community as this appears to be a random issue or something I’m not catching. Not sure what you mean by keep trying, but not use HTML. How would I keep trying to resolve the issue without using the module that uses HTML? $table variable shouldn’t matter. Just assume it is using get-service to create the table variable. This should be straight forward and have provided all other information. If there wasn’t a course providing information on how to simply create this, I wouldn’t be asking a question in a forum and would do more research (which I also have done without any luck). Trying to get to the bottom of why the Java portion is not working and figured maybe Don could chime in since he created the module.</p>

    • #224730
      Participant
      Topics: 9
      Replies: 678
      Points: 2,683
      Helping Hand
      Rank: Community Hero

      It just seems to me you need to get more acquainted with powershell in general before moving on to HTML in powershell. Maybe someone here has some experience with enhanced html. I’ll tell you I got both makedynamictable and makehiddenselection to “work” but not with the java query. Saying I can’t get makedynamictable to work is not accurate, it’s more like “I can’t get all of these things to work together,” in my opinion. Either way, I feel strongly that just a few hours or even a few days is not sufficient enough effort to say you can’t get something to work and/or ask for help. Again, my advice is to start with smaller portions, figure out the nuances of one particular parameter before trying to get them all to work. I wish you the best of luck, sir.

      P.S. I haven’t seen Don post on here in a good while. Also, please consider this module hasn’t been updated since 2017.

    • #224760
      Participant
      Topics: 36
      Replies: 59
      Points: 133
      Rank: Participant

      <p style=”text-align: left;”>

      It just seems to me you need to get more acquainted with powershell in general before moving on to HTML in powershell. Maybe someone here has some experience with enhanced html. I’ll tell you I got both makedynamictable and makehiddenselection to “work” but not with the java query. Saying I can’t get makedynamictable to work is not accurate, it’s more like “I can’t get all of these things to work together,” in my opinion. Either way, I feel strongly that just a few hours or even a few days is not sufficient enough effort to say you can’t get something to work and/or ask for help. Again, my advice is to start with smaller portions, figure out the nuances of one particular parameter before trying to get them all to work. I wish you the best of luck, sir.

      P.S. I haven’t seen Don post on here in a good while. Also, please consider this module hasn’t been updated since 2017.

      Not sure why you would assume I’m a beginner with powershell. But anyways – thanks for your help with the separate module issue I had. The zip didn’t include all of the required components.</p>
       

      If anyone else would like to chime in, I am still looking for some advice for anyone that has used this module or worked with jQuery/datatables in the past. Thanks.

    • #224787
      Participant
      Topics: 9
      Replies: 678
      Points: 2,683
      Helping Hand
      Rank: Community Hero

      I didn’t assume you were a beginner. My experience with powershell and helping others with powershell has taught me that it takes time to get it to do exactly what you want/expect. Time requirements of much more than a day, especially depending on the topic. You are trying to use a custom made module, not even a core powershell module. Have you mastered convertto-html already? I know very few people who could just take a module with so many advanced concepts involved and be proficient in a week, let alone a day. I wasn’t trying to be condescending, so please don’t take it the wrong way. Do you feel you put in reasonable time and effort into learning that module prior to starting this thread?

    • #224946
      Participant
      Topics: 36
      Replies: 59
      Points: 133
      Rank: Participant

      Thought I’d post the solution. Chrome wasn’t liking the syntax of the script lines in the HTML file. It worked okay in IE once I allowed the content to be passed. However, Chrome wasn’t passing the js files through and showing a syntax error in the javascript console when the page was loaded. This led me to compare HTML files from working sites that use datatables and saw that working ones had the following: <script type=”text/javascript” language=”javascript” src=”http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.2.min.js”></script&gt;

      The psm1 for the EnhancedHTML2 module does not include the language=”javascript” section. I have updated the psm1 and everything is displaying correctly.

      How HTML is displayed for script line from EnhancedHTML2:

      <script type=”text/javascript” src=”http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.2.min.js”></script&gt;

    • #228955
      Participant
      Topics: 9
      Replies: 678
      Points: 2,683
      Helping Hand
      Rank: Community Hero

      Here’s a working example compiled from the info here

      https://github.com/krzydoug/EnhancedHTML2

Viewing 10 reply threads
  • The topic ‘EnhancedHTML2 MakeTableDynamic Not Working’ is closed to new replies.