感謝您閱讀我的文本。 這是項目我使用(引導表)
http://bootstrap-table.wenzhixin.net.cn/documentation/bootstrap-table可編輯擴展和x-editable writeback JSON
我使用一個表與選項:
data-toggle="table"
data-url="api/api.php/"
data-side-pagination="client"
data-query-params="queryParams"
data-response-handler="responseHandler"
data-pagination="true"
data-page-list="[10, 25, 50, 100, ALL]"
data-page-size="20"
data-sort-name="nr"
data-sort-order="desc"
data-striped="true"
data-show-refresh="true"
data-show-columns="true"
data-height="720"
data-detail-view="true"
data-detail-formatter="detailFormatter"
data-sortable="true"
data-search="true"
data-show-export="true"
data-export-types="['excel']"
都沒有很好地工作。它從JSON中的API接收顯示數據。
現在的問題:
我想添加一些可編輯的字段。 像我在一個例子中看到的我包括這些東西:
[example]
http://issues.wenzhixin.net.cn/bootstrap-table/#extensions/editable.html
[included stuff]
JS:
bootstrap-table/extensions/editable/bootstrap-table-editable.js
http://rawgit.com/vitalets/x-editable/master/dist/bootstrap3-editable/js/bootstrap-editable.js
CSS:
http://rawgit.com/vitalets/x-editable/master/dist/bootstrap3-editable/css/bootstrap-editable.css<br>
我添加用於測試「數據編輯=」 true」屬性到我的上表中的字段的一個 結果是,它光學地改變但它不回寫到我的api它只顯示在瀏覽器上的變化如果我刷新頁面的變化已經消失
直到我沒有使用jquery,我想我需要它呢?在Table或Tableoptions上的任何地方定義一個PK來讓它正常工作? 有人可以給我一個例子,我可以如何寫回(POST)到API(URL)並格式化JSON,它應該發佈到A請問PI嗎?
希望有人使用這個項目,可以幫助我。 對不起,如果有什麼不清楚,或者我做錯了。我不是開發人員。 Iam不確定這裏的「標籤」。希望它是正確的。
非常感謝大家!
我沒有得到console.log工作..似乎這個函數沒有被調用。 (field,row,oldvalue,$ el){console.log(field,row,oldvalue);}}}函數onEditableSave(field,row,oldvalue,$ el){ console.log //寫一個ajax調用,將值返回給你的數據庫 }' – PeterPlanlos
請你能否給我另一個例子? – PeterPlanlos