javascript - Django Client Side Filtering -
I am very new to Genzo and I am working on the site where I want to be able to filter the user Objects can be easily filterable in views.py and reload the template based on objects timestamp, but how should I make this filtering client?
Would it be a good idea to load everything:
{all_objects for obj%} & lt; P & gt; {{Obj.time}} & lt; / P & gt; {% Endfor%}
And then use javascript to hide and show relevant items? I do not expect more than 1,000 items
I have taken a look at this: And the author says that he will use angular JS instead of a custom AJAX solution.
Is angle my best choice or are there other structures that are easy to integrate with the DEGENGO?
You do not need full frameworks like Koner to filter your results, Want to use one of the popular MVC frameworks, however, if you go that route, then you should change the architecture of your dégggo app quite a bit, because Kangaroo and actually created for single-page applications Land, and you will look best if is exposed to your Dijengo API rather than project HTML.
To solve your problem, I continue to use the same DJ ango template, and loading the contents of the list into hidden HTML elements. Then in your page's JavaScript code, you can remove relevant items from the list based on user selections. This code will be fully javascript, though.
As a tip, I will use a DJ ango template to insert filtering criteria as the data attributes of my hidden HTML tags. An example:
{all_objects%} for obj%} & lt; P data-time = '{{obj.time}}' data-somefilter = '{{obj.somefiter}}' & gt; {{Obj.time}} & lt; / P & gt; {% Endfor%}
In this way you can easily use Jquery selectors to filter the data based on requirements and then copy the results to the visible HTML section where You display a filtered list
Comments
Post a Comment