动态表分桶

发布于 2024-10-23 12:16:45 字数 1530 浏览 2 评论 0原文

我已经搜索过网络,但找不到完全解决我当前问题的解决方案。我希望用户能够根据列的值对表行进行分组。它们也应该是可折叠的。

示例数据:

Size   Number   Place   Name
----   ------   -----   ----
S      10       NY      First
S      15       NY      Another
S      20       DE      Second
M      10       NY      Third
L      4        DE      Fourth

然后,用户应该能够看到列列表(大小、数量、位置)并将它们拖到垂直轴上。然后,这将自动按相似的列值对行进行分组。用户还应该能够指定层次结构,例如 Place ->尺寸->姓名。这里有一个例子:

                  Number
---------------------------
(-) NY            35 [sum]
    (-) S          25
         First      10
         Another    15
    (-) M          10
         Third      10
(-) DE            24
    (-) S          20
         Second     20
    (-) L          4
         Fourth     4

折叠,比如说,纽约显然会显示:

                  Number
---------------------------
(+) NY            35
(-) DE            24
    (-) S          20
        Second      20
    (-) L          4
        Fourth      4

这里的技巧是用户应该能够简单地重新排列订单,并且它会重新排列它。因此,如果他们想查看尺寸 ->地点->名称...:

                  Number
---------------------------
(-) S             35
    (-) NY         25
         First      10
         Another    15
    (-) DE         20
         Second     20
(-) M             10
    (-) NY         10
         Third      10
(-) L             4
    (-) DE         4
         Fourth     4

希望这是有道理的。有谁知道有什么好方法来做到这一点?我不关心数据库的架构 - 假设我可以将其转换成任何必要的形式(即从 MySQL 使用 PHP 调用它,使用 Perl 从 CSV 中抓取它,等等)。前端是我最关心的。

I've scoured the net, but I can't find a solution that quite solves my current problem. I want the user to be able to group table rows based on the values of columns. They should be collapsible, too.

Example data:

Size   Number   Place   Name
----   ------   -----   ----
S      10       NY      First
S      15       NY      Another
S      20       DE      Second
M      10       NY      Third
L      4        DE      Fourth

The user should then be able to see a list of the columns (Size, Number, Place) and drag them onto the vertical axis. This will then automatically group the rows by similar column values. The user should also be able to specify a hierarchy, such as Place -> Size -> Name. Here would be an example of that:

                  Number
---------------------------
(-) NY            35 [sum]
    (-) S          25
         First      10
         Another    15
    (-) M          10
         Third      10
(-) DE            24
    (-) S          20
         Second     20
    (-) L          4
         Fourth     4

Collapsing, say, NY would obviously show:

                  Number
---------------------------
(+) NY            35
(-) DE            24
    (-) S          20
        Second      20
    (-) L          4
        Fourth      4

The trick here is that the user should be able to simply rearrange the order, and it will rebucket it. So if they then wanted to see Size -> Place -> Name...:

                  Number
---------------------------
(-) S             35
    (-) NY         25
         First      10
         Another    15
    (-) DE         20
         Second     20
(-) M             10
    (-) NY         10
         Third      10
(-) L             4
    (-) DE         4
         Fourth     4

Hopefully that makes sense. Does anyone have an idea of a good way to do this? I don't care about the architecture of the database - assume I can get it into whatever form is necessary (i.e. calling it with PHP from MySQL, grabbing it out of a CSV with Perl, anything). The front-end is what I'm concerned about mostly.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七度光 2024-10-30 12:16:45

如果您需要在 HTML 中执行此操作,那么我想 https://github.com/mauriciosantos/buckets这会对你有帮助。您可以针对您的情况使用多词典。它是免费的,并且支持 IE6 及以上的浏览器。祝一切顺利:-)

If you are needing to do this in HTML then I guess https://github.com/mauriciosantos/buckets this will help you. You can use Multi dictionary for ur case. Its free and it supports browsers from IE6.All the best :-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文