0
試圖讓jeditable編輯多個環節,更新結果的onsubmitjeditable編輯多個環節
function inlineEditData(linkId){
$('.inlineLinkEdit_' + linkId).editable('crudDocumentationLink.htm', {
event : 'editclick',
submit : 'Save',
cancel : 'Cancel',
indicator : '<img src="images/indicator.gif">',
width : 600,
onsubmit : function(value, settings) {
$('.inlineLink_' + linkId).href=value;
$('.inlineLink_' + linkId).innerHTML=value;
$('.inlineLink_' + linkId).show();
$('.inlineLinkEdit_' + linkId).hide();
$('.inlineLinkTrigger_' + linkId).show();
},
onreset : function(value, settings) {
$('.inlineLink_' + linkId).show();
$('.inlineLinkEdit_' + linkId).hide();
$('.inlineLinkTrigger_' + linkId).show();
}
});
}
function editLink(linkId){
$('.inlineLink_' + linkId).hide();
$('.inlineLinkEdit_' + linkId).show();
$('.inlineLinkTrigger_' + linkId).hide();
inlineEditData(linkId);
$('.inlineLinkEdit_' + linkId).trigger('editclick');
}
和HTML:
<a href="${document.link}" class="inlineLink_${document.id}" id="inlineEdit_${document.id}">${document.link}</a>
<span style="display:none;" class="inlineLinkEdit_${document.id}" id="inlineEdit_${document.id}">${document.link}</span>
<span class="inlineLinkTrigger_${document.id}" onclick="editLink(${document.id})" style="cursor:pointer;">edit</span>
編輯工作。但我希望根據用戶輸入更新頁面上的值。那麼我的代碼有什麼問題?