Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pagination buttons will trigger form post #1248

Open
tekken22 opened this issue Dec 6, 2022 · 0 comments
Open

pagination buttons will trigger form post #1248

tekken22 opened this issue Dec 6, 2022 · 0 comments
Labels
bug fix Something isn't working

Comments

@tekken22
Copy link

tekken22 commented Dec 6, 2022

Describe the bug
when grid is used inside of form tag (aspx page, asp.net, form required) it will trigger postback because button type is not specified
and default is type=submit.

To Reproduce
have grid container inside of the form tags and use client side grid with local array as data source but with pagination (no server side calls) and click next.

Expected behavior
grid loads next page, it works fine but immideately after that a form submit occures and entire page is reloaded.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10 Pro
  • Browser: Microsoft Edge
  • Version: 108.0.1462.42 (Official build) (64-bit)

Additional context
this will fix the issue if called after grid is rendered.
code:
document.getElementById("divLog").querySelectorAll('[role="button"]').forEach(function (el) {
el.setAttribute("type", "button");
});

rafzei added a commit to rafzei/gridjs that referenced this issue Dec 28, 2022
@afshinm afshinm added the bug fix Something isn't working label Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants