JSを使うのはこれが初めてなので、自分が何をしているのか本当にわかりません。
データを含むテーブルがあり、jEditable を使用してユーザーがデータを編集し、php スクリプトに POST できるようにします。ユーザーが「保存」を押すと、php スクリプトからのデータで jQuery UI が開き、正常に動作しているように見えますが、ユーザーがキャンセルまたは Esc を押して jQuery UI ダイアログを閉じると、ページに戻りますが、編集しようとしたセルは完全に空になりました。セルを再設定するにはどうすればよいですか?
ありがとうございました!
$(".editable_textarea").editable("/path/to/my/script.php", {
indicator : "<img src='/images/indicator.gif'>",
type : 'textarea',
submitdata: { _method: "post", uri: "<?php echo $this->uri->segment(3); ?>" },
select : false,
submit : 'Save',
cancel : 'Cancel',
tooltip : "Click to edit...",
cssclass : "editable",
onblur: "cancel",
cssclass: "edit_destination",
callback:
function(value, settings) {
$(this).dialog({
autoOpen: true,
width: 400,
modal: true,
position: "center",
resizable: false,
draggable: false,
title: "Pending Changes",
buttons: {
"Cancel": function() {
$(this).dialog("close"); },
"Confirm Changes": function() {
document.findSameDestination.submit(); }
}
});
$('form#findSameDestination').submit(function(){
$(this).dialog('open');
return false;
});
$(this).editable("disable");
},
data:
function(value, settings) {
var retval = value.replace(/<br[\s\/]?>/gi, '\n');
retval = retval.replace(/(<([^>]+)>)/gi, '');
return retval;
}
});
これを修正する方法がまだわかりません。賞金を提供するのに十分なポイントがありません...