dandelion / dandelion-datatables

Dandelion component for DataTables
http://dandelion.github.io/components/datatables/
Other
110 stars 49 forks source link

[CLOSED] Cookie callback function generated without return sentence #210

Closed tduchateau closed 10 years ago

tduchateau commented 10 years ago

Issue by marsanm2 from Wednesday Sep 25, 2013 at 08:07 GMT


When cookie callback is activated in JSP:


 <datatables:table>
    ...
    <datatables:callback type="cookie" function="cookieCallback" />
    ...
 </datatables:table>
And related callback function is created:

    <script type="text/javascript">
    function cookieCallback(sName, oData, sExpires, sPath) {
        // Customise oData or sName or whatever else here
        return sName + "=" + JSON.stringify(oData) + "; expires=" + sExpires + "; path=" + sPath;
    }
    </script>
Next code is generated:

var oTable_l_com_springsource_petclinic_domain_Owner_params = {
   "bDeferRender":false,
   "bStateSave":true,
   "bServerSide":false,
   "sScrollY":"300px",
   "bFilter":true,
   "bSort":true,
   "bJQueryUI":false,
   "fnCookieCallback":function(sName,oData,sExpires,sPath){cookieCallback(sName,oData,sExpires,sPath);},
   ...
This produces next error:

jquery.dataTables.js:4515 Uncaught TypeError: Cannot call method 'split' of undefined
I think the return sentence is missing at last line of generated code:

   "fnCookieCallback":function(sName,oData,sExpires,sPath){return cookieCallback(sName,oData,sExpires,sPath);},
Regards !
tduchateau commented 10 years ago

Comment by tduchateau from Wednesday Sep 25, 2013 at 17:19 GMT

Hi,

You're absolutely right. It will be fixed in the 0.9.2-SNAPSHOT.

Thanks!

Regards, Thibault

tduchateau commented 10 years ago

Comment by marsanm2 from Friday Oct 04, 2013 at 06:33 GMT

Thanks Thibault !

From DiSiD we are waiting this fantastic new version to integrate it with Roo. Have you plans about release the new version soon ?

Thanks a regards !

tduchateau commented 10 years ago

Comment by tduchateau from Friday Oct 04, 2013 at 06:44 GMT

Hi,

Actually, it has been released during the night, but keep it secret, I have not announced it yet... ;-)