带有表单数据的 Drupal 寻呼机
我有一个表单,显然它接受一些元素,然后针对外部数据库运行选择。我可以毫无问题地返回数据。我遇到的问题是让寻呼机正确提交。对 pager_query() 的初始请求很好,并正确显示内容和寻呼机。但是,当我选择寻呼机链接时,寻呼机只是重建表单而不提交。我看到 GET 请求被添加到顶部的 url 中,但仅此而已。然后我必须手动提交表单才能使寻呼机正常工作。有人见过这种情况发生吗?我尝试编写一些 ajax 来劫持请求并提交 GET 但仍然遇到相同的问题。
I have a form that obviously takes in some elements and then runs a select against an external database. I can present the data back without issue. What I'm having trouble with is getting the pager to submit correctly. the initial request to pager_query() is good and displays back the content and pager correctly. However, when i select the pager link, the pager simply rebuilds the form and does not submit. I see the GET request get added to the url at the top but that's it. I have to then manually submit the form for the pager to work correctly. Has anyone seen this happen? I tried to write some ajax to hijack the request and submit a GET but still running into the same issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 Drupal 寻呼机时有一些陷阱。第一个是,如果单个页面上有多个 pager_query(),则页面上的每个“pager”元素默认情况下仅引用第一个查询。因此,您应该做的第一件事是检查您没有对不同的数据库使用多个 pager_queries。如果您使用的是 Drupal 7.0,那么正确形成的分页器查询应如下所示:
如果您设法找到重复的分页器查询,则您可以使用以下方法设置要引用的分页器查询:
如果您使用的是 Drupal 6,则解决方案可能略有不同。
There are a couple of pit-falls when using Drupal pagers. The first is that if you have several pager_query()'s on a single page, then every 'pager' element on the page willby default only reference the first query. So the first thing you should do is check you aren't using multiple pager_queries to different databases. If you are using Drupal 7.0, then this is what a properly formed pager query should look like:
If you manage to find duplicate pager queries, then you can set which pager query to reference by using:
If you are using Drupal 6, then the solution might be slightly different.