<div dir="ltr">Hi guys, <div><br></div><div>Pablo was asking about Datatables which is a JS plugin, not databases :)</div><div><br></div><div>Pablo, In Smalltalk hub there are a couple of DataTables projects. It would be interesting to know which one is the &quot;official&quot;.</div><div>Second, please ask in Seaside mailing list. </div><div><br></div><div>For my client, I forked the original DatatablesFileLibrary because I needed extra plugins. And then, I simple used JS. So the steps are simply add the file library into the libs of your app. Then render some html table. Finally, invoke some JS. Either from jQuery or from normal JS.</div><div><br></div><div>Note that I can imagine that some of the Datatables found in Smalltalkhub should have examples. Check them out. </div><div><br></div><div>Something like this  (it&#39;s full of domain stuff and probably I am copy pasting with errors but will help you to get the idea):</div><div><br></div><div>1) Register lib to app:</div><div><br></div><div>app addLibrary: DataTablesFileLibrary  (or whatever class name is it)</div><div><br></div><div>2) Then render table and container (whatever you want, however you want...you simple need a container and a table). </div><div><br></div><div><div>containerDiv := html div.</div><div><span class="" style="white-space:pre">                        </span>containerDivId := containerDiv ensureId.</div><div><span class="" style="white-space:pre">                        </span>containerDiv</div><div><span class="" style="white-space:pre">                                </span>class: &#39;reportContainer&#39;;</div><div><span class="" style="white-space:pre">                                </span>with: [   </div></div><div><div>                                           html   table </div><div><span class="" style="white-space:pre">                                                                </span>id: self tableId;</div><div><span class="" style="white-space:pre">                                                                </span>with: [ self renderTableOn: html. ]. </div></div><div><br></div><div><b>html script: (FaDataTablesHelper datatablesScriptFor: tableID tableHeightString: &#39;&quot;scrollY&quot;:  (0.80 * $(window).height()),&#39; containerDivId: containerDivId). <br></b></div><div><br></div><div>The magic here is that to the generated table you pass via #script:  the Datatables JS. </div><div><br></div><div>3) Generate datatables JS:</div><div><br></div><div><div>FaDataTablesHelper  class &gt;&gt; datatablesScriptFor: tableID tableHeightString: aTableHeightString containerDivId: aContainerDivId</div><div><br></div><div> ^ &#39;</div><div><span class="" style="white-space:pre">        </span>$(document).ready(function() { </div><div><span class="" style="white-space:pre">                                        </span></div><div><span class="" style="white-space:pre">                </span>var getCellText = function (elem) {</div><div>                    //get only the element text</div><div>                    return elem.contents().filter(function() {</div><div>                        return this.nodeValue;</div><div>                    }).text();</div><div>                };<span class="" style="white-space:pre">                        </span></div><div><span class="" style="white-space:pre">                                        </span></div><div><span class="" style="white-space:pre">                </span>// this is so that the table does not use all the height space and hence the horizontal scroll looks outside the empty space.</div><div><span class="" style="white-space:pre">                </span>// By default, we make the table a max height of a % of the windows.</div><div><span class="" style="white-space:pre">                </span></div><div><span class="" style="white-space:pre">                </span>var oTable = $(&#39;&#39;#&#39;, tableID asString ,&#39;&#39;&#39;).DataTable( { </div><div><span class="" style="white-space:pre">                        </span> &#39;, aTableHeightString, &#39;</div><div>        <span class="" style="white-space:pre">                </span>&quot;scrollX&quot;: &quot;100%&quot;,</div><div>        <span class="" style="white-space:pre">                </span>&quot;scrollCollapse&quot;: true,</div><div>        <span class="" style="white-space:pre">                </span>&quot;paginate&quot;: false,</div><div><span class="" style="white-space:pre">                        </span>&quot;stateSave&quot;: false,</div><div><span class="" style="white-space:pre">                        </span>&quot;stateDuration&quot;: -1,</div><div><span class="" style="white-space:pre">                        </span>&quot;destroy&quot;: true,</div><div><span class="" style="white-space:pre">                        </span>&quot;filter&quot;: false,</div><div><span class="" style="white-space:pre">                        </span>&quot;ordering&quot;: false,</div><div><span class="" style="white-space:pre">                        </span>&quot;searching&quot;: false,</div><div><span class="" style="white-space:pre">                        </span>&quot;sort&quot;: false,</div><div><span class="" style="white-space:pre">                        </span>&quot;orderClasses&quot;: false,</div><div><span class="" style="white-space:pre">                        </span>&quot;autoWidth&quot;: false,</div><div><span class="" style="white-space:pre">                        </span>&quot;jQueryUI&quot;: false,</div><div><span class="" style="white-space:pre">                        </span>// J: ColResize.</div><div><span class="" style="white-space:pre">                        </span>// I: ColPin. It needs ColReorder.</div><div><span class="" style="white-space:pre">                        </span>// R: ColReorder</div><div><span class="" style="white-space:pre">                        </span>// &quot;dom&quot;: &#39;&#39;C&lt;&quot;clear&quot;&gt;Rt&#39;&#39;,</div><div><span class="" style="white-space:pre">                        </span>&quot;dom&quot;: &#39;&#39;t&#39;&#39;,</div><div><span class="" style="white-space:pre">                        </span>// colVis: {</div><div><span class="" style="white-space:pre">                </span>     //     label: function (index, title, th) {</div><div><span class="" style="white-space:pre">                </span>     //       return $(&#39;&#39;a[href]&#39;&#39;, th).text() || getCellText($(th));</div><div><span class="" style="white-space:pre">                </span>      //    }</div><div><span class="" style="white-space:pre">                </span>      //  },</div><div><span class="" style="white-space:pre">                        </span>// this is in case I want to use the paginate for the Scroller</div><div><span class="" style="white-space:pre">                        </span>&quot;iDisplayLength&quot;: -1</div><div><span class="" style="white-space:pre">                </span>    } );</div><div><br></div><div><span class="" style="white-space:pre">                </span>// oTable.colResize.init({fixedLayout: true, dblClick: &#39;&#39;matchContent&#39;&#39;});</div><div><span class="" style="white-space:pre">                </span>// Previosuly it was the below line, but this is bad...because if the widths of the columns keep fixed </div><div><span class="" style="white-space:pre">                </span>// all along the session, we may wast a lot of space because columns were kepts with its original width...</div><div><span class="" style="white-space:pre">                </span>// and when filtering, sorting, etc..the width of the column changes to better adjust its width needs...&quot;</div><div><br></div><div><br></div><div><span class="" style="white-space:pre">                </span>// Check if body width is higher than window width :)</div><div><span class="" style="white-space:pre">                </span>if (  $(&#39;&#39;#&#39;, tableID asString ,&#39;&#39;&#39;).width() &gt; $(&quot;#&#39;, aContainerDivId,&#39;&quot;).width() ) {</div><div><br></div><div><span class="" style="white-space:pre">                        </span></div><div><span class="" style="white-space:pre">                        </span>// Add default fixedColumns </div><div><span class="" style="white-space:pre">                        </span>// oTable.colPin.init({</div><div><span class="" style="white-space:pre">                        </span></div><div>                <span class="" style="white-space:pre">        </span>//<span class="" style="white-space:pre">        </span>fixedColumns: {</div><div><span class="" style="white-space:pre">                        </span>//<span class="" style="white-space:pre">                </span>leftColumns: 1,</div><div><span class="" style="white-space:pre">                        </span>//<span class="" style="white-space:pre">                </span>rightColumns: 1,</div><div><span class="" style="white-space:pre">                        </span>//<span class="" style="white-space:pre">                </span>heightMatch: &#39;&#39;auto&#39;&#39;</div><div><span class="" style="white-space:pre">                        </span>//<span class="" style="white-space:pre">        </span>}</div><div><span class="" style="white-space:pre">                        </span>// });</div><div><span class="" style="white-space:pre">                        </span></div><div><span class="" style="white-space:pre">                        </span>new $.fn.dataTable.FixedColumns( oTable, {</div><div>        leftColumns: 1,</div><div><span class="" style="white-space:pre">        </span>rightColumns: 1</div><div>    } );</div><div><span class="" style="white-space:pre">                </span></div><div><span class="" style="white-space:pre">                        </span></div><div><span class="" style="white-space:pre">        </span></div><div><span class="" style="white-space:pre">                </span>};  //table is bigger than container</div><div><br></div><div><br></div><div>    </div><div><span class="" style="white-space:pre">        </span>}); // document on load</div><div><span class="" style="white-space:pre">                                </span></div><div><span class="" style="white-space:pre">        </span>&#39;.</div></div><div><br></div><div><br></div><div><br></div><div>This point 3) depends completely on how you want to use Datatables. Read it&#39;s documentation in order to know what you need/want. </div><div><br></div><div>Also..use the Developer Tools of the browser (console) since you may have missing plugins, or wrong JS code etc. That console will be your friend until you make it work.</div><div><br></div><div>Cheers, </div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 5, 2015 at 11:25 AM, <a href="mailto:phil@highoctane.be">phil@highoctane.be</a> <span dir="ltr">&lt;<a href="mailto:phil@highoctane.be" target="_blank">phil@highoctane.be</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have used this datatable package in Seaside in my app.<div><br></div><div><div>MCSmalltalkhubRepository</div><div><span style="white-space:pre-wrap">        </span>owner: &#39;GastonDallOglio&#39;</div><div><span style="white-space:pre-wrap">        </span>project: &#39;DataTables&#39;</div><div><span style="white-space:pre-wrap">        </span>user: &#39;&#39;</div><div><span style="white-space:pre-wrap">        </span>password: &#39;&#39;</div><div><br></div><div>For the examples, looking at the Datatables JS API was helpful. The version was the older one.</div><div><br></div><div>You can use it like this (there is some bootstrap mixed in)</div><div><br></div><div><div>html tbsTable </div><div><span style="white-space:pre-wrap">                </span>beStriped;</div><div><span style="white-space:pre-wrap">                </span>beHover;</div><div><span style="white-space:pre-wrap">                </span>script:<span style="white-space:pre-wrap">        </span>((html jQuery new  dataTable) bFilter: false; bPaginate: false; bInfo: false); </div><div><span style="white-space:pre-wrap">                </span>class: &#39;table-responsive&#39;; </div><div><span style="white-space:pre-wrap">                </span>with: [</div><div><span style="white-space:pre-wrap">                </span>html tableHead with: [ </div><div><span style="white-space:pre-wrap">                        </span>html tableHeading with: &#39;ID&#39; seasideTranslated .</div><div><span style="white-space:pre-wrap">                        </span>html tableHeading with: &#39;MAC&#39; seasideTranslated . </div><div><span style="white-space:pre-wrap">                        </span>html tableHeading with: &#39;IP&#39; seasideTranslated .</div><div><span style="white-space:pre-wrap">                        </span>html tableHeading with: &#39;Status&#39; seasideTranslated <span style="white-space:pre-wrap">                        </span> </div><div><span style="white-space:pre-wrap">                        </span>].</div><div><span style="white-space:pre-wrap">                                                </span></div></div><div>....</div></div><div><br></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 5, 2015 at 9:09 AM, stepharo <span dir="ltr">&lt;<a href="mailto:stepharo@free.fr" target="_blank">stepharo@free.fr</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    You can use <br>
        - Voyage to access MongoDB read the entreprise Pharo book <br>
        - Garage for relational databases.<br>
    <br>
        <a href="http://pharo.org/news/garage-database" target="_blank">http://pharo.org/news/garage-database</a><br>
    Stef<br>
    <br>
    <br>
    <div>Le 4/12/15 15:58, Pablo R. Digonzelli a
      écrit :<br>
    </div>
    <blockquote type="cite">
      <div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:#000000">
        <div>Hi, I am interesting in using Datatables in a Seaside app.</div>
        <div>I know there is wrapper fot this in StHub. Is there is
          examples how to use it?</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>TIA</div>
        <div><br>
        </div>
        <div>
          <div><strong><strong><span style="font-family:tahoma,new york,times,serif;font-size:medium"></span></strong></strong>
            <hr><strong><span style="font-family:tahoma,new york,times,serif;font-size:medium">Ing. Pablo Digonzelli</span></strong><br>
            <span style="font-family:tahoma,new york,times,serif;font-size:small;color:rgb(0,0,0)">Software Solutions</span><br>
            <span style="font-family:tahoma,new york,times,serif;font-size:small;color:rgb(0,0,0)">IP-Solutiones SRL</span></div>
          <div><span style="font-size:small;color:rgb(0,0,0)">Metrotec
              SRL</span><br>
            <span style="font-family:tahoma,new york,times,serif;font-size:small;color:rgb(0,0,0)">25 de Mayo 521</span></div>
          <div><span style="font-family:tahoma,new york,times,serif;font-size:small;color:rgb(0,0,0)">San Miguel de
              Tucumán</span></div>
          <div><span style="font-family:tahoma,new york,times,serif;font-size:small;color:rgb(0,0,0)">Email:
              <a href="mailto:pdigonzelli@softsargentina.com" target="_blank">pdigonzelli@softsargentina.com</a></span><br>
            <span style="font-family:tahoma,new york,times,serif;font-size:small;color:rgb(0,0,0)"><a href="mailto:pdigonzelli@gmail.com" target="_blank">pdigonzelli@gmail.com</a></span><br>
            <span style="font-family:tahoma,new york,times,serif;font-size:small;color:rgb(0,0,0)">Cel: 5493815982714</span></div>
        </div>
      </div>
    </blockquote>
    <br>
  </div>

</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br></div>
</div>