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. newforms-admin edit callback-url hook by myers 6 years ago
  2. admin: edit related object shortcut by christian 6 years, 6 months ago
  3. Confirm alert if the user navigates away without saving changes by mrazzari 4 years, 9 months ago
  4. models ColorField with clean minimal widget by andybak 2 years, 11 months ago
  5. Admin: ordering by multiple fields in a column sort by benatkin 3 years, 9 months ago

Comments

(Forgotten your password?)