would it be possble to define datatables as an anonymous AMD module?

would it be possble to define datatables as an anonymous AMD module?

AdamSAdamS Posts: 14Questions: 3Answers: 0

Hi Allan,

I don't know if you have a specific requirement to have a named requireJS module, but it would be nice to be able to use it as an anonymous AMD module. However there may be a reason for it to be named.

This would help to integrate datatables into other projects more easily, just a minor issue. We can live with both scenarios.

TIA

Answers

  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin

    It is named for safely and consistency, in the same way that jQuery is named. The extensions of DataTables (TableTools for example) make an assumption about the named module (they have to since they are plug-ins, again in the same way as happens for jQuery and its plug-ins).

    How do you handle jQuery as a named module at the moment? Can you use a similar method for DataTables?

    Allan

  • AdamSAdamS Posts: 14Questions: 3Answers: 0

    Hi allan,

    Yes that makes sense, it am using also jsTree that has a plugin system and they recently changed from named to anonymous. Currently jQuery is the only named that we have. It's not a big issue right now. Thanks for your reply!

  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin

    Been thinking about it over the last couple of days, I I think I'm going to keep DataTables as a named module, but have all of the plug-ins for it be anonymous. They depend on DataTables, so it makes sense for consistency to have DataTables named, as jQuery is, but the plug-ins don't need to be, and it creates more work that it solves.

    I'll do a mass release of the updated extensions soon.

    Allan

This discussion has been closed.