Login

jQuery Double Click Edit ManyToMany in Admin

Author:
justhamade
Posted:
January 22, 2010
Language:
JavaScript
Version:
Not specified
Tags:
admin jquery manytomany double-click
Score:
0 (after 0 ratings)

Put this in your templates/admin/change_form.html template and you will be able to double click a manytomany in a multi select to be able to edit it.

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

Comments

Please login first before commenting.