Hacker News new | ask | show | jobs
by TazeTSchnitzel 4949 days ago
Why the special grid/row/cell tags and special data inpits? Why not just use a vanilla HTML table, then you would at least have graceful degradation?
1 comments

For the XML format? Good point that would be better.
Yeah. What I'm thinking is, instead of loading external XML, you could just have something like:

  <table id=fancy-table>
      <thead>
          <tr><th>Column 1</th><th>Column 2</th><th>Column 3</th></tr>
      </thead>
      <tbody>
          <tr><td>Item 1</td><td>Item 2</td><td>Item 3</td></tr>
      </tbody>
  </table>

  <script>
    new Grid("fancyTable", {
      srcType : "html",
      srcData : '#fancy-table',
      allowGridResize : true, 
      allowColumnResize : true, 
      allowClientSideSorting : true, 
      allowSelections : true, 
      allowMultipleSelections : true, 
      showSelectionColumn : true, 
      fixedCols : 1
    });
  </script>
(This way, if JS is unsupported/the JS code breaks/JS is disabled/slow connection/etc., you'll still see the data)