jQuery Double Click Edit ManyToMany in Admin

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
{% extends "admin/change_form.html" %}
{% load i18n admin_modify adminmedia %}

{% block extrahead %}
{{ block.super }}
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>

<script type="text/javascript">
$(function() {
	$('select').bind("dblclick", function(){
		var popup_url = $(this).next().attr('href').replace('add',$(this).val());
		window.open(popup_url+'?_popup=1','WINDOW_NAME','height=500,width=800,resizable=yes,scrollbars=yes')
	});
});
<script>
{% endblock %}

More like this

  1. admin: edit related object shortcut by christian 5 years, 8 months ago
  2. Adding buttons to submit line in a Admin page by marinho 5 years, 1 month ago
  3. "Save and Continue" keyboard command for admin, with autoscroll by jcushman 3 years, 5 months ago
  4. Unobtrusvie Foldable Admin Interface by whiteinge 5 years, 4 months ago
  5. Confirm alert if the user navigates away without saving changes by mrazzari 3 years, 11 months ago

Comments

(Forgotten your password?)