ajax更新后将焦点设置为确认消息

发布于 2024-10-05 15:58:38 字数 302 浏览 0 评论 0原文

我有一个列表页面(有数据网格)。我确实在每行中都有编辑按钮,单击该按钮会打开叠加层(ajax 模式弹出窗口)。插入/更新数据后,我必须刷新数据网格以显示新插入的数据,并在页面顶部显示消息,说明数据已成功插入/更新。

由于我在页面周围有更新面板,页面的焦点集中在我单击编辑按钮的行上,因此用户实际上必须一直向上滚动才能看到成功的消息。有什么办法可以在ajax更新后将焦点/滚动一直向上设置,以便用户可以看到记录是否更新成功。

注意:我在关闭模式弹出窗口后调用 updatepanel.update() 方法来刷新更新面板。

任何帮助将不胜感激。

I have a listing page(that has datagrid). I do have edit button in each row clicking that opens up overlay (ajax modal popup). After inserting/updating data, I have to refresh data grid to display newly inserted data and displays message on the top of page saying Data is inserted/updated successfully.

Since I have update panel around the page, page has a focus on the row where I click edit button so users actually have to scroll all the way up to see successful message. Is there any way I can set focus/scroll all the way up after ajax update so user can see whether the record is updated successfully or not.

Note: I am calling updatepanel.update() method to refresh update panel after closing modal popup.

Any help will be appreciated.

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

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

发布评论

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

评论(1

旧时光的容颜 2024-10-12 15:58:38

好的旧命名锚标签会对您有帮助吗?

例如

<a name="messageOnTop">my message</a>
<!-- big data grid -->

<!-- button that opens the overlay doing business -->
<a href="#" onclick="doOverlay(); 
    /* when finished with overlay: */ 
    document.location = '#messageOnTop'">button</a>

上面只是伪代码。我想说的是,你可以通过URL中的#符号跳转到锚点

Would the good old named anchor tag help you?

e.g.

<a name="messageOnTop">my message</a>
<!-- big data grid -->

<!-- button that opens the overlay doing business -->
<a href="#" onclick="doOverlay(); 
    /* when finished with overlay: */ 
    document.location = '#messageOnTop'">button</a>

The above is just pseudo-code. What I want to say, is that you can jump to the anchor with the #-notation in the URL

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