Skip to content

Current pageNumber is not reset after a submit error #7917

@ivan-ortega-grifols

Description

@ivan-ortega-grifols

Bootstraptable version(s) affected

1.24.2

Description

Hi there,

I'm having problems with my bootstrap-table after submit (with form errors). Here we have the issue detailed:

Preconditions

  • Have a browser with pagination and column sort available
  • Have an input with a submit button

Steps
1- Paginate to any page different from the first one (for example page 2)
2- Sort by any colum (and the browser automatically displays the first page again with the new sorting applied)
3- Force a submit error (typing something wrong within the input and clicking submit button for e.g.)

Expected:
Page is reloaded with the sort applied in the step 2 and the first page displayed

Resulto:
Page is reloaded with the sort applied in the step 2 but with the page paginated in the step 1

Example(s)

No response

Possible Solutions

Workaround for me (force to update the page displayed to 1 when sort is applied)

$table.on("sort.bs.table", function (event, row, $element, field) {
	$table.bootstrapTable('selectPage', 1)
});

Thank you!

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIssues which are marked as Bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions