title: How can I set DataTables row callbacks in a Shiny R application?
body: <p>In rCharts, one can set JS callbacks of DataTables using a special string notation: <code>#! function(par) {...} !#</code>. For example, let's look into the following R code:</p>
  
  <pre class="lang-r prettyprint-override"><code>  #JS callback to truncate long strings in table cells and add a tooltip
    callback = "#! 
    function (nRow) {
          $('td', nRow).each(function (index) {
              var maxChars = 80;
                  var unfilteredText = $(this).text();
                  if (unfilteredText.length &gt; maxChars &amp;&amp; maxChars &gt; 3) {
                      $(this).attr('title', unfilteredText);
                      $(this).html(unfilteredText.substring(0, maxChars-4) + '...');
                  }
          });
          return nRow;
      } !#"
  
    result &lt;- dTable(df, aaSorting = list(c(5, "desc")), sPaginationType="full_numbers",
                 fnRowCallback=callback)
  </code></pre>
  
  <p>Is this possible in Shiny DataTables?</p>