Pagination not posting all pages data through
Pagination not posting all pages data through
mp252
Posts: 2Questions: 1Answers: 0
I am using datatables within the flask-gentelella (https://github.com/afourmy/flask-gentelella) as it is already provided. However I have a dynamic form created in a template where the table is within the form. The table has pagination, so each time I select something from page 1 and page 5, on the server side, it only posts the data through for page 5. My form looks like so;
<form method='post' action="">
<table id="datatable-checkbox" class="table table-striped table-bordered bulk_action">
<thead>
<tr>
<th>Deal Uploaded</th>
<th>Not Relevant Article</th>
<th>Info</th>
<th>Date</th>
<th>Link</th>
</tr>
</thead>
<tbody>
{% for x in data %}
<tr>
{% for subfield in form['article|'~x.id ] %}
<td>{{ subfield }}</td>
{% endfor %}
<td>{{ x.info }}</td>
<td>{{ x.date.strftime('%d/%m/%Y') }}</td>
<td>
<a href={{ x.link }} target="_blank">
More Details
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<button class="btn btn-primary" type="submit" id="test" name="SaveAll">Save changes</button>
</div>
</form>
This discussion has been closed.
Answers
The action is left blank because it is a wtform
Hi @mp252 ,
Without seeing a working example, I'd suspect the problem is with the format of the data being returned from the server-side script. If you look at this page here, it details the format expected, so it would be worth ensuring your scripts are compliant.
If still no joy, we're happy to take a look, but it would help, as per the forum rules, if you could link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin