SlickGrid 使用单元格按钮向上/向下行的最佳方式

发布于 2024-09-10 21:53:18 字数 126 浏览 1 评论 0原文

我用按钮向上/下行搜索问题。 我正在尝试使用“grid.getCurrentCell”,但是当我单击按钮时,currentCell 尚未定义。

我该怎么做?

谢谢。

(抱歉我的英语不好)

I search an issue to up/down row with buttons.
I m trying to use 'grid.getCurrentCell' but when i click button currentCell is not yet define.

How can i do this ?

Thanks.

(sorry for my poor english)

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

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

发布评论

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

评论(1

谈下烟灰 2024-09-17 21:53:18

您也许可以使用行的 ID 来完成此操作。创建行时,将按钮设置为

其中 23 是数据中的索引。您还可以通过调用以下命令来更新它:

for(var i in data)
  data[i]['upButtonColumn']="<a onclick='moveUp("+i+")'><img src='up.gif'></a>";
grid.removeRows(rows);
grid.render(); 

或类似的东西,但这会更慢。

You can probably do this using the ID of your row. When you create the row, set the button to
<a onclick='moveUp(23)'><img src='up.gif'></a>

Where 23 is the index in your data. You could also update this by calling:

for(var i in data)
  data[i]['upButtonColumn']="<a onclick='moveUp("+i+")'><img src='up.gif'></a>";
grid.removeRows(rows);
grid.render(); 

Or something similar, but that would be slower.

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