如何禁用 cfgrid 单元格中空白行的 href 链接?

发布于 2024-08-11 03:36:31 字数 499 浏览 1 评论 0原文

我有以下 cfgrid:

<cfgrid format="html" name="grid" pagesize="10" selectmode="row" striperows="yes"
        bind="cfc:data.getData({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})">
        <cfgridcolumn name="link" header="Link" href="link.cfm" hrefkey="link_id">
</cfgrid>

由于 pagesize 为 10,如果网格中的行数少于 10 行,我将有一些空白行。对于那些空白行,我会用“-”符号代替通常的数据,并且 hrefkey 将为 null 而不是通常的 link_id。有没有办法禁用空白行的 href?或者是否有办法用 javascript 捕获 null 值?

I have the following cfgrid:

<cfgrid format="html" name="grid" pagesize="10" selectmode="row" striperows="yes"
        bind="cfc:data.getData({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})">
        <cfgridcolumn name="link" header="Link" href="link.cfm" hrefkey="link_id">
</cfgrid>

Since pagesize is 10, I'll have some blank rows if I have less than 10 rows in the grid. For those blank row I'd have a '-' sign in place of the usual data, and the hrefkey will be null instead of the usual link_id. Is there a way to disable the href for blank rows? Or if there's a way to capture the null value with javascript?

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

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

发布评论

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

评论(1

浅浅淡淡 2024-08-18 03:36:31

您可以循环遍历表中的 a href,找到所有包含“-”的 href,并将其更改为其他内容或完全删除该 href。这可以在 JS 中完成,但理想情况下我会尝试预先执行此操作(即在 CF 中),因为使用 JS 执行此操作会产生开销。

You can loop through the a hrefs within the table and find all the hrefs that contain the '-' and change this to something else or remove the href completely. This can be done in JS but ideally I would try and do this before hand (i.e in CF) as there will be an overhead using JS to do this.

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