Defer my feature after initialisation

Defer my feature after initialisation

RoyLingRoyLing Posts: 26Questions: 0Answers: 0
edited November 2012 in Plug-ins
I've created a plugin of DataTable, but I would just like it be loaded after the DataTable ('t' in sDom) is initialized. Is this supported or not? If so, what should I do? Thanks!

Replies

  • RoyLingRoyLing Posts: 26Questions: 0Answers: 0
    edited November 2012
    I've found the solution.

    [code]oTable.oApi._fnCallbackReg(oSettings, "aoInitComplete",
    function() {
    // initialise my plugin
    }, "myPluginName");[/code]
  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    That's it. What does the plug-in do out of interest? :-)

    Allan
  • RoyLingRoyLing Posts: 26Questions: 0Answers: 0
    edited November 2012
    I integrated another jquery plugin (jquery treeTable - http://ludo.cubicphuse.nl/jquery-plugins/treeTable/doc/#usage) into DataTable which supports to display rows as a tree.
  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    Sounds fantastic! Might you be able to post it up on Github (or similar)? I'm sure others would be interested in using your work :-)

    Allan
  • RoyLingRoyLing Posts: 26Questions: 0Answers: 0
    Yes, I will improve and refine it first and then publish it as you suggested. Thanks!
  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    Wonderful! Looking forward to seeing what you've cooked up!

    Allan
  • RoyLingRoyLing Posts: 26Questions: 0Answers: 0
    @Allan,

    I've created a git repo(https://github.com/RoyLING/jquery.dataTables.TreeTable) for this plugin I worked out - integrate jquery.treeTable plugin into DataTables.

    Appreciate if you can provide some suggestions :-)

    Regards,
    Roy
  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    Fantastic! If you were able to put up an example, I'm sure that would help a lot of folks (including myself) understand what is going on more quickly.

    Allan
  • RoyLingRoyLing Posts: 26Questions: 0Answers: 0
    edited December 2012
    See the live example - http://live.datatables.net/utayag/12/edit#javascript,html,live
    - Seems there's some issue in 'Render' view, but ok in preview panel, so check out the result in preview panel
    - The fnPreInit option in my plugin is not working as expected when the table data source is DOM (I will check why). Instead I did the preparation work in fnCreatedRow callback to get the same
This discussion has been closed.