是否有一个表格对象可以免费使用JavaScript的排序功能?(Is there a table object with sorting functionality freely available

编程入门 行业动态 更新时间:2024-10-28 11:29:51
是否有一个表格对象可以免费使用JavaScript的排序功能?(Is there a table object with sorting functionality freely available for JavaScript?)

我需要对基于表格的JavaScript应用程序中的表进行抽象。 我计划制作一个具有以下功能的JavaScript类

构造函数从一组对象中创建表 构造函数根据标题数组和数据数组创建表 用任何一列进行排序的方法 将表分成页面并遍历它们的方法 将对象绑定到HTML元素的方法,在其中绘制HTML表格表示

该类将会很小,很轻,并且包含在一个JavaScript文件中。 此外,该课程可供任何人免费使用。

但在我可能重新发明轮子之前,我必须问:

像这样的东西已经存在了吗? (我找不到任何东西)

I am in need of an abstraction for tables in a JavaScript application that is heavily table-based. I plan on making a JavaScript class with the following functions

Constructor to create the table from an array of objects Constructor to create the table from an array of headers and an array of data Methods for sorting by any of the columns Methods for splitting the table into pages and traversing them Methods for tying the object to a HTML element, drawing a HTML table representation inside it

The class will be small, light and contained in a single JavaScript file. Also the class will be free to use for anybody.

But before I possibly reinvent the wheel, I have to ask:

Does something like this exist already? (I couldn't find anything)

最满意答案

该类将会很小,很轻,并且包含在一个JavaScript文件中。 此外,该课程可供任何人免费使用。

一旦你有了这个限制,我敢肯定,使用某人的API或实现你自己的API之间的权衡会导致你'重新发明轮子',因为理解API并将其适应你当前代码的时间可能不值得,与努力实施相比。

无论如何,如果你仍然想使用一些API,我发现这个帖子可能可以帮助你。 祝你好运。

The class will be small, light and contained in a single JavaScript file. Also the class will be free to use for anybody.

Once you have that restriction, I'm pretty sure that the tradeoff between using someone's API or implementing your own will lead you to 'reinvent the wheel', because the time to understand that API and adapt it to your current code maybe is not worth, compared to the effort to implement.

Anyway, if you still wants to use some API, i've found this post somewhere that maybe can help you. Good luck.

更多推荐

本文发布于:2023-07-19 16:56:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1183564.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:有一个   表格   对象   功能   sorting

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!