自动将行添加到数据视图?

发布于 2025-01-04 06:17:09 字数 89 浏览 2 评论 0原文

我使用数据视图控件和寻呼机添加行控件来允许用户向数据视图添加更多行。

我可以扩展寻呼机添加行控件,以便在用户到达屏幕底部时自动将行添加到数据视图吗?

I am using a Data View control and the Pager Add Rows control to allow the user to add more rows to the data view.

Can I extend the Pager Add Rows control to automatically add rows to the Data View when the user reaches the bottom of screen?

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

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

发布评论

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

评论(1

一曲琵琶半遮面シ 2025-01-11 06:17:09

是的,您可以使用 jquery 轻松做到这一点。如果你精通道场,你可能可以用类似的方式做到这一点。但这个例子展示了 jQuery。

  1. 将 jQuery 添加到您的 xpage
  2. 将一个新的自定义脚本库添加到您的 xpage
  3. 将下面的代码放入您的自定义脚本库
  4. 将 addPageRows 控件添加到您的 xpages 并将其连接到重复。
  5. 一切就绪,快来试试吧。

<前><代码>$(函数(){
$(窗口).scroll(函数(){
if($(window).scrollTop() == $(document).height() - $(window).height()){
$("[id$='pagerAddRows1_ar'],[id$='pagerAddRows2_ar']").click();
}
});
})

jquery 代码将尝试查找 pagerAddRows1_ar 或 pagerAddRows2_ar,如果找到,将在到达屏幕底部时自动单击该链接。

实际上,您可以将此代码与 xpage 上的任何类型的寻呼机或链接一起使用。只需确保您的代码点击正确的 ID 即可。

Yes, you can do that easily with jquery. if you master dojo you can probably do it in similar ways. but this example show jQuery.

  1. add jQuery to your xpage
  2. add a new custom scriptlibrary to your xpage
  3. put below code in your custom scriptlibrary
  4. Add a addPageRows control to your xpages and connect it to a repeat.
  5. All set, try it out.
$(function(){
  $(window).scroll(function(){
        if($(window).scrollTop() == $(document).height() - $(window).height()){
            $("[id$='pagerAddRows1_ar'],[id$='pagerAddRows2_ar']").click();
                  }
        });
})

The jquery code will try and find pagerAddRows1_ar or pagerAddRows2_ar and if found will click the link automatically when you reach the bottom of screen.

You can actually use this code with any kind of pager or link you have on your xpage. just make sure your code click the right id.

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