我尝试在Boostrap Modal上使用Django Versatilimagefield,但PPOI无效...
这是我的代码
<div class="row">
<!-- Modal add image-->
<div class="modal fade" id="image_modal" tabindex="-1" role="dialog" aria-labelledby="add_imageLabel" >
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Ajouter/Editer une image</h4>
</div>
<div class="modal-body" style="margin:10px;">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Fermer</button>
</div>
</div>
</div>
</div>
</div>
然后从javascript函数中插入表单
<script>
$(document).ready(function(){
$('.openPopup').on('click',function(){
var dataURL = $(this).attr('data-href');
$('.modal-body').load(dataURL,function(){
$('#image_modal').modal({show:true});
});
});
});
</script>
谁在Modal主体上插入此表单代码
<form role="form" action="/intranet/laboutique/product/image/editer/{{tab_data.pk_product}}/{{tab_data.pk_image}}/" method="post" enctype="multipart/form-data" name="add_image_form">
{% csrf_token %}
<div class="row">
<div class="form-group" id="image_form">
{{tab_data.image_form.media}}
{{tab_data.image_form}}
</div>
<input id="url_next" name="url_next" type="hidden" value="{{request.path}}">
<button type="submit" class="btn btn-danger" name="submit_save_image">Sauvegarder</button>
</div>
</form>
除PPOI之外,其他所有工具都工作正常,我无法移动Point,并且Double Click也无法正常工作...我认为这是Dom问题...寻求帮助