tnc-ba / strongTNC

BYOD TNC Database Management Tool
GNU Affero General Public License v3.0
0 stars 0 forks source link

Ajax paging #140

Closed d22 closed 10 years ago

d22 commented 10 years ago

Added ajax based paging. I hope I didn't "over-engineer" it. Most of the options can be set in the HTML table. The python ajax function provides the list used to render the template to HTML with a strategy-like pattern. Is it possible to handle all this easier?

The following works at the moment:

Open:

I created a test page http://localhost:8000/paging

@dbrgn or @cfaessler, pls review. Tnx.

dbrgn commented 10 years ago

Didn't really review this yet, just had a quick look over it. It looks very nice clean, but what I had in mind was rather using the built-in pagination framework (https://docs.djangoproject.com/en/dev/topics/pagination/) and rendering the resulting output to HTML, which can then be injected as a whole block into the DOM. Then you don't need a central registry and don't need to handle all the navigation stuff in JavaScript. And it would probably make things like sorting easier, which will probably get quite tricky using the way it's implemented right now.

On the other hand, I didn't do a real code review yet and maybe our data model is too convoluted for the regular paginator :) Although I think it would work.

Let's discuss it later.

Edit: This is the library I created at my previous job: https://github.com/dbrgn/django-simplepaginator Forgot to send you the URL last week. I didn't use it in a long time, don't know whether it still works well with current Django. It probably does though.

dbrgn commented 10 years ago

Done with review. Sorry for the many comments, you LITERALLY asked for it :shipit:

d22 commented 10 years ago

Ready to merge!