Dojo 网格模板

发布于 2024-09-26 23:30:30 字数 262 浏览 4 评论 0原文

在 asp.net 中,DataGrid 支持模板。您可以提供自己的模板,并让网格填充模板中的数据。

使用 Dojo Grid,我似乎无法在 Dojo 提供的严格简单的单元格样式网格之外制作自己的模板。

有谁知道如何在 Dojo Grid 中使用自定义模板?具体来说,使用 Dojo,您必须使用与数据项相对应的单元格。我希望使用表格作为模板,并具有我选择的任何样式(行、列、行跨度、列跨度、单个单元格中的多个数据项等)。

请问有什么线索吗?

谢谢

In asp.net the DataGrid supports templates. You can provide your own template and have the grid fill the data in your template.

With Dojo Grid, it seems like I can't make my own template outside of the the rigid simplistic cell style grid that Dojo provides.

Does anyone know a way to use a custom template with Dojo Grid? Specifically, with Dojo you're forced to use a cell that corresponds to a data item. I'm looking to use a table as a template with any styling that I choose (rows,columns,rowspans,colspans, more than one data items in a single cell, etc).

Any clues please?

Thanks

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

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

发布评论

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

评论(1

梦里人 2024-10-03 23:30:30

首先,听起来您想要的一切都可以通过自定义网格来获得。您可以嵌套单元格,甚至可以在行中进行过滤选择之类的操作。不幸的是,这方面的文档并不出色,因此如果您想要非常定制的功能,则需要谷歌搜索和反复试验。

其次,由于 Dojo 的 OO 本质,您始终可以使用继承来创建各种小部件的混合。具体来说,_templated 类允许您为小部件指定 HTML 模板,该模板本身可以包含模板化小部件。

如果这听起来很重要,那么你是对的,这就是为什么我建议深入研究增强网格,并可能在尝试自己编写一些东西之前打开代码。

我可以告诉你,我很难让它正常工作,但我对我需要的功能感到惊喜,我认为我需要自己构建这些功能,但这些功能已内置到网格中。

Firstly, it sounds like everything you want is available by customizing the grid. You can do nesting of cells and even have things like Filtering Selects in rows. Unfortunately the docs on this are not awesome so it takes Googling and trial and error if you want very customized features.

Secondly, because of the OO nature of Dojo you can always use inheritance to create mixes of various widgets. Specifically the _templated class allows you to specify an HTML template for your widget, which themselves can included templated widgets.

If that sounds non-trivial, you're right, which is why I would suggest digging deeper into the Enhanced grid and probably open up the code before trying to write something yourself.

I can tell you that I struggled getting it working correctly, but I have hence been pleasantly surprised by features that I needed that I thought I would need to build myself but were built into the grid.

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