ColReorder reorderCallback should have "settings" parameter

ColReorder reorderCallback should have "settings" parameter

hubohubo Posts: 45Questions: 14Answers: 0

I think that reorderCallback should have "settings" parameter like initComplete and other events.

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 61,664Questions: 1Answers: 10,095 Site admin
    Answer ✓

    The function is executed in the scope of the instance, so this.s will get you the settings object. However, I would strongly point out that this is an internal property. It can, will and does change between versions. It is not indented to be a public API.

    Allan

  • hubohubo Posts: 45Questions: 14Answers: 0

    Yes, I find out that I can use "this.s.dt", but as you say, it can change in the future. So it will be great if you add "this.s.dt" as the first argument of the function like other events has.

  • allanallan Posts: 61,664Questions: 1Answers: 10,095 Site admin
    Answer ✓

    Changing the arguments would break backwards compatibility. But I will look into a better fix that is consistent across all extensions.

    Allan

  • hubohubo Posts: 45Questions: 14Answers: 0

    I do not know, if I am expressed good myself.

    Now the ColReorder has reorderCallback:

    reorderCallback : function () { /* Some code. */ }

    And I think it will be fine if it can be:

    reorderCallback: function (e) { /* Some code, but e will now represents this.s.dt. (Right now it is undefined.) */ }

  • allanallan Posts: 61,664Questions: 1Answers: 10,095 Site admin
    Answer ✓

    Yes, that would work - sorry, I had forgotten that there were no parameters for the function.

    However, I would rather make a consistent API for all extensions. I will look into this for a future release.

    Allan

This discussion has been closed.