Datatable 1.9.4 ColReorder : "Cannot call method 'proxy' of undefined"

Datatable 1.9.4 ColReorder : "Cannot call method 'proxy' of undefined"

niki4810niki4810 Posts: 7Questions: 0Answers: 0
edited January 2013 in Bug reports
Hi,

After updating to datatables 1.9.4, I notice that the ColReorder plugin is throwing the following exception

Issue:

Source: http://10.16.18.34:9091/platform/libs/js/datatables/ColReorder.js

Line # 407

Error: Uncaught TypeError: Cannot call method 'proxy' of undefined

Fix:

To fix the above issue I just add to change jQuery.proxy to $.proxy on line #407 in the ColReorder plugin

Before fix:

oDTSettings.oApi._fnCallbackReg(oDTSettings, 'aoDestroyCallback', jQuery.proxy(this._fnDestroy, this), 'ColReorder');

After the fix :

oDTSettings.oApi._fnCallbackReg(oDTSettings, 'aoDestroyCallback', $.proxy(this._fnDestroy, this), 'ColReorder');


Upon making the above change I fixed the issue with colReorder. Just wanted to let the community know about this.


Thanks,

Nikhil

Replies

  • niki4810niki4810 Posts: 7Questions: 0Answers: 0
    I also noticed a similar issue in the ColVis.js plugin. Specifically in Line#856 where there were calls for

    if ( jQuery.browser.msie && JQuery.browser.version == "6.0" )

    The fix is to use '$' instead of jQuery as shown below

    if ( $.browser.msie && $.browser.version == "6.0" )

    NOTE: While this might not be an issue while loading the libraries externally, but if your project has a RequireJS AMD setup then you would see this issue.

    Is there a way I can submit a pull request for these fixes ?

    Thanks,

    Nikhil
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    > Is there a way I can submit a pull request for these fixes ?

    https://github.com/DataTables/ColVis :-)

    Allan
  • niki4810niki4810 Posts: 7Questions: 0Answers: 0
    Thanks Allan, I forked the datatables repo and dint find the extras folder, so I was not sure how I can submit the fixes. I Will submit a pull request soon. :)
  • niki4810niki4810 Posts: 7Questions: 0Answers: 0
    Hi Allan,

    I submitted two pull requests one for ColVis plugina and the other for ColReorder plugins, here are associated links :

    ColReorder :
    https://github.com/DataTables/ColReorder/pull/6

    ColVis:
    https://github.com/DataTables/ColVis/pull/11

    Thanks,
    Nikhil
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Thank you :-). Both now merged and will be in the next versions of each.

    Allan
This discussion has been closed.