I
I
Isaac Clark2012-06-05 14:14:22
JavaScript
Isaac Clark, 2012-06-05 14:14:22

How to create a jQuery module and manage it from the Django admin panel?

Hello.
Please tell me or share a link to the material.
I wrote a module in jQuery, now I want to attach it to Django in such a way that I can make changes to it without affecting the javascript code itself.
For example: the module I created is a regular menu for a site. I want to make it possible to add new menu items, change the menu font color, etc. by going to the django admin panel.
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WildZero, 2012-06-05
@WildZero

As an option: from the admin panel, you generate a file with settings (for example, a regular json), but the plugin already grabs these settings.

Q
qrazydraqon, 2012-06-05
@qrazydraqon

The effort to separate the presentation from the logic is commendable, but it must be done the moment you write the jQuery menu plugin. Generate HTML / CSS as usual through templates, using data from the database, and rewrite the javascript so that it pulls all the necessary data directly from the menu structure. Well, or through AJAX, as WildZero suggests.
It's hard to say something more specific, because it's hard to imagine why you needed to write a plugin for a "regular menu" and how it might look like.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question