Re: Trigger an event on add another

2012-11-28 Thread is_null
FTR, another solution is to intercept creation of  tags with 
DOMNodeInserted. Requires no monkey patch and is compatible with django & 
django-grappelli out of the 
box: https://github.com/yourlabs/django-autocomplete-light/commit/1f1e715e20

Thanks again for your answer (which I credited in the related github issue).

Rock'on

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/0WE7Hx4YOXwJ.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Trigger an event on add another

2012-11-23 Thread is_null
My bad I didn't see Mark's mail, I'll subscribe to the list and hopefully 
this shouldn't happen again.

Thanks Mark for answering

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/0SuXBSwTQMoJ.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Trigger an event on add another

2012-11-23 Thread James Pic
All Django admin would have to do is call:
$(this).trigger('django.admin.another_added') or something like that.

It really sounds like little work and would allow user defined callbacks to
be executed.

What do you think ?


On Fri, Nov 9, 2012 at 12:29 PM, James Pic  wrote:

> Hi all,
>
> Is it possible to trigger an event on add-another ?
>
> Or is there a better solution to work around this problem ?
> https://github.com/yourlabs/django-autocomplete-light/blob/master/autocomplete_light/static/autocomplete_light/widget.js#L267
>
> Thanks for answering
>
> Regards
>



-- 
http://blog.yourlabs.org
Customer is king - Le client est roi - El cliente es rey.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Trigger an event on add another

2012-11-09 Thread Mark Lavin
When I was working on a similar issue for django-selectable I created an 
issue to address this problem with a simple proof of concept patch 
https://code.djangoproject.com/ticket/15760. However I never followed 
through with the ticket to try to get something like this added. In the 
meantime another ticket was created and fixed which solves a large portion 
of the problem https://code.djangoproject.com/ticket/18241. With this 
change you can catch the click event of the add button. I still feel like 
the admin inline javascript is not particularly flexible and having some 
clearly documented hooks for this use case would be nice.

For what it's worth my solution in django-selectable was to patch the 
formset function to include my callback 
https://bitbucket.org/mlavin/django-selectable/src/efede3aa83ec6d372626eaac6f54c188287ec3d2/selectable/static/selectable/js/jquery.dj.selectable.js?at=default#cl-289
 Not 
the prettiest solution but it works.

Best,

Mark

On Friday, November 9, 2012 6:30:17 AM UTC-5, is_null wrote:
>
> Hi all,
>
> Is it possible to trigger an event on add-another ?
>
> Or is there a better solution to work around this problem ? 
> https://github.com/yourlabs/django-autocomplete-light/blob/master/autocomplete_light/static/autocomplete_light/widget.js#L267
>
> Thanks for answering
>
> Regards
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/zvzeX-CiNDgJ.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Trigger an event on add another

2012-11-09 Thread James Pic
Hi all,

Is it possible to trigger an event on add-another ?

Or is there a better solution to work around this problem ?
https://github.com/yourlabs/django-autocomplete-light/blob/master/autocomplete_light/static/autocomplete_light/widget.js#L267

Thanks for answering

Regards

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.