皆さん、こんにちは。 私はjQuery: Refresh div after another jquery action? を見てきました。私はテーブルをデータベースから生成し、削除をクリックすると、行を削除し、divをリフレッシュしますが、その後は私のjquery関数は動作しません。私の体でMVC f/wでjQueryを使ってdivをリフレッシュしようとしています
$('#docs td.delete').click(function() {
$("#docs tr.itemDetail").hide();
var i = $(this).parent().attr('id');
$.ajax({
url: "<?php echo site_url('kt_docs/deleteDoc'); ?>",
type: 'POST',
data: 'id=' + i,
success: function(data) {
$("#docs tr.itemDetail").hide();
$("#f1").html(data); // wont work twice
//$("#docs").load(location.href+" #docs>*"); //works once as well
}
});
});
私は
<fieldset class='step' id='f1'>
<?php $this->load->view('profile/docs_table'); ?>
</fieldset>
プロファイル/ドキュメントを持ってDBからデータを読み込みます。 <table id='docs'>....</table>
と私のコントローラ:事前に
function deleteDoc() {
$id = $_POST['id'];
$this->load->model('documents_model');
$del = $this->documents_model->deleteDocument($id);
return $this->load->view('docs_table');
}
ありがとう!
ありがとう、ありがとう、ありがとう!完璧! – Alanagh
うれしかった! :) – Wayne