codeigniter 2.1 を使用してプラグインを完全に動作させています。私は現在、いくつかのビューで構成される動的に生成されたページの一部としてプラグインを使用しようとしています。
これを行うには、コントローラーに次のものが含まれています。
$this->load->view('blue_view_widget'); // the file upload view
$this->load->view('form'); // a form
template-upload および template-download テーブル (javascript によって生成される) が、フォーム ビューの html によって上書きされていることがわかります。JavaScript がビューの下部にテーブルを動的に生成する前に、2 番目のビューからの html がエコーアウトされると (おそらく間違って) 考えています。どうすればこれを修正できますか?
これは私のコードです:
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<!-- <tr class="template-download fade">-->
<tr class="template-download ">
{% if (file.error) { %}
<td></td>
<td class="name"><span>{%=file.name%}</span></td>
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
{% } else { %}
<td class="preview">{% if (file.thumbnail_url) { %}
<a href="{%=file.url%}" title="{%=file.name%}" rel="gallery" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a>
{% } %}</td>
<td class="name">
<a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'gallery'%}" download="{%=file.name%}">{%=file.name%}</a>
</td>
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
<td colspan="2"></td>
{% } %}
<td class="delete">
<button class="btn btn-danger" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}">
<i class="icon-trash icon-white"></i>
<span>{%=locale.fileupload.destroy%}</span>
</button>
<input type="checkbox" name="delete" value="1">
</td>
</tr>
{% } %}
</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
<script src="blueimp/js/vendor/jquery.ui.widget.js"></script>
<!-- The Templates plugin is included to render the upload/download listings -->
<script src="http://blueimp.github.com/JavaScript-Templates/tmpl.min.js"></script>
<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
<script src="http://blueimp.github.com/JavaScript-Load-Image/load-image.min.js"></script>
<!-- The Canvas to Blob plugin is included for image resizing functionality -->
<script src="http://blueimp.github.com/JavaScript-Canvas-to-Blob/canvas-to-blob.min.js"></script>
<!-- Bootstrap JS and Bootstrap Image Gallery are not required, but included for the demo -->
<script src="http://blueimp.github.com/cdn/js/bootstrap.min.js"></script>
<script src="http://blueimp.github.com/Bootstrap-Image-Gallery/js/bootstrap-image-gallery.min.js"></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="blueimp/js/jquery.iframe-transport.js"></script>
<!-- The basic File Upload plugin -->
<script src="blueimp/js/jquery.fileupload.js"></script>
<!-- The File Upload file processing plugin -->
<script src="blueimp/js/jquery.fileupload-fp.js"></script>
<!-- The File Upload user interface plugin -->
<script src="blueimp/js/jquery.fileupload-ui.js"></script>
<!-- The localization script -->
<script src="blueimp/js/locale.js"></script>
<!-- The main application script -->
<script src="blueimp/js/main.js"></script>
<!-- The XDomainRequest Transport is included for cross-domain file deletion for IE8+ -->
<!--[if gte IE 8]><script src="js/cors/jquery.xdr-transport.js"></script><![endif]-->
THE SECOND VIEW ('FORM') BEGINS HERE.
<div class="container">
<base href="http://localhost/bootstrap1/">
<!-- <div class="row">-->
<fieldset>
<legend>Registration</legend>
<div class="span10" class="well">
<form class="well" id="registerHere" method='post' action='index.php/site/process_form'>
//
<div class="form_row" >
<div class="control-group">
<label class="control-label" for="textarea">Textarea</label>
<div class="controls">
<textarea class="span8" class="input-xlarge" id="description" name="description" rel="popover" data-content="Re-enter your description." data-original-title="description" rows="3"></textarea>
</div>
</div>
</div>
<div class="form_row" >