可編者的表格:jQuery+PHP+jeditable實現即時編輯表格欄位內容

來源:互聯網
上載者:User
可編輯的表格:jQuery+PHP+jeditable實現即時編輯表格欄位內容

介紹一款超級實用的jquery外掛程式叫jeditable,即傳說中的即時編輯外掛程式。所謂即時編輯就是,實現無重新整理修改網頁內容的一個功能,並且無需重新整理即可即時顯示修改結果。具體舉例,見外掛程式官方網站的demo:http://www.appelsiini.net/projects/jeditable/custom.html,點擊可修改的文本即可!

//參數設定

$('.edit').editable('save.php', {
width :120,
height :18,
//onblur : "ignore",
cancel : '取消',
submit : '確定',
indicator : '',
tooltip : '單擊可以編輯...',
callback : function(value, settings) {
$("#modifiedtime").html("剛剛");
}

//select參數設定,其他方式見連結 參考文檔1

$('.edit_select').editable('save.php', {
loadurl : 'json.php',
type : "select",
cancel : '取消',
submit : '確定',
indicator : '',
tooltip : '單擊可以編輯...',
style : 'display: inline'
});


//調用jquery ui的datepicker日曆外掛程式
$.editable.addInputType('datepicker', {
element : function(settings, original) {
var input = $('');
input.attr("readonly","readonly");
$(this).append(input);
return(input);
},
plugin : function(settings, original) {
var form = this;
$("input",this).datepicker();
}

demo下載

參考文檔1

查考文檔2

查考文檔3

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.