Datatables in Angular

Datatables in Angular

c-myers1c-myers1 Posts: 43Questions: 16Answers: 0

A question for almost a philosophical reason: is there any plan (or need in fact) to make an Angular 5 version of DataTables?

I'm no Angular expert but very aware of purists' advocacy for not using jQuery within Angular if it can be avoided. I'm also very aware jQuery components such as DataTables CAN work in Angular. I don't know enough to know if there are edge cases where the jQuery+Angular combination will be non-performant or errant hence my question.

Replies

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    You mean basically you want a version of DataTables that will work without jQuery?

    Currently no, that isn't on our roadmap. The reason being that it would take a very significant amount of time and effort to replicate a lot of its functionality.

    Some things such as the selectors could easily be replaced; selectors and the basic event listeners, but other items such as the ajax controls, namespaced events and backwards compatibility with legacy browsers would be much more difficult to replace. That is development time that I would rather be spending working on DataTables feature set, rather than replacing the already battle hardened jQuery.

    I understand that jQuery isn't really the darling of the Javascript world that it once was, but I do very much believe that it still has a place and is an excellent library for other libraries such as DataTables to build on. Thus at the moment I don't believe that there is any need to rewrite parts of jQuery into DataTables core. Indeed, it would just be moving the functions that jQuery provides into DataTables, making DataTables larger!

    Now, I need to qualify that! There is jQuery slim, and other libraries such as Zepto which it would be attractive to be able to use DataTables with. To that end, my current plan is to provide an abstraction layer to DataTables for much of the jQuery functionality (ajax being the first candidate for that). That would allow either another library to be used to provide that functionality, or if someone wished to, they could just write it from the ground up.

    Also to address your final point, I'm not aware of any edge cases that would cause performance problems with DataTables in an Angular setting, but if there are, I would consider that a bug and if a test case showing the issue were provided we'd look into it.

    Regards,
    Allan

  • c-myers1c-myers1 Posts: 43Questions: 16Answers: 0

    I don't know that removal of jQuery dependency makes a component a first-class angular citizen but making DT work across as wide a variety of frameworks/ platforms makes most sense from your perspective. My question comes from my preference for angular and the big fuss I see from the likes of kendo and primeng viz rewriting their code from ground up removing this dependency ostensibly for performance reasons.

    I agree jQuery still has a place. Missed mention of this abstraction layer in your roadmap.

This discussion has been closed.