0
我試圖插入一個數據表編輯器爲基礎的表到一個WordPress頁面(看到here),和我運行到以下錯誤:TypeError: f[("editor_" + c)] is undefined
jquery插件在noConflict模式之外拋出「TypeError」?
什麼納悶這是我用jQuery(function ($) {
擺脫noConflict
模式,但這個問題仍然存在。
任何想法爲什麼?
這是jQuery的我使用建表:
jQuery(function ($) {
$(document).ready(function(e) {
var editor = new $.fn.dataTable.Editor({
"ajaxUrl": "../wp-content/plugins/contacts/php/table.wp_contacts.php",
"domTable": "#wp_contacts",
"fields": [
{
"label": "Contact",
"name": "contact",
"type": "text"
},
{
"label": "Company",
"name": "company",
"type": "text"
},
{
"label": "Email",
"name": "email",
"type": "text"
},
{
"label": "Phone",
"name": "phone",
"type": "text"
},
{
"label": "Fax",
"name": "fax",
"type": "text"
},
{
"label": "Tax ID",
"name": "tax_id",
"type": "text"
},
{
"label": "Address",
"name": "address",
"type": "text"
}
]
});
$('#wp_contacts').dataTable({
"sDom": "Tfrtip",
"sAjaxSource": "../wp-content/plugins/contacts/php/table.wp_contacts.php",
"aoColumns": [
{
"mData": "contact"
},
{
"mData": "company"
},
{
"mData": "email"
},
{
"mData": "phone"
},
{
"mData": "fax"
},
{
"mData": "tax_id"
},
{
"mData": "address"
}
],
"oTableTools": {
"sRowSelect": "multi",
"aButtons": [
{ "sExtends": "editor_create", "editor": editor },
{ "sExtends": "editor_edit", "editor": editor },
{ "sExtends": "editor_remove", "editor": editor }
]
}
});
});
});