Jquery ui 在管理菜单区使用jQuery jTable和Wordpress插件

Jquery ui 在管理菜单区使用jQuery jTable和Wordpress插件,jquery-ui,jquery-plugins,wordpress,jquery-jtable,Jquery Ui,Jquery Plugins,Wordpress,Jquery Jtable,希望使用jQuery jTable插件从数据库中获取和添加/编辑记录。我已经将所需的脚本排队,并验证它们是否通过页面源加载,但我没有得到任何结果。根据《入门指南》,我至少应该得到一张空白表,但我得到的是一张空白页。我的代码在下面-有什么想法吗 使脚本排队的代码: function lfc_load_scripts() { //set global variables global $plugin_url; //set variable to use to point to process.ph

希望使用jQuery jTable插件从数据库中获取和添加/编辑记录。我已经将所需的脚本排队,并验证它们是否通过页面源加载,但我没有得到任何结果。根据《入门指南》,我至少应该得到一张空白表,但我得到的是一张空白页。我的代码在下面-有什么想法吗

使脚本排队的代码:

function lfc_load_scripts() {
//set global variables
global $plugin_url;

//set variable to use to point to process.php path
$js_vars = array('plugin_url'=>$plugin_url,);

//Load scripts and css for Tabs UI
wp_enqueue_script('jquery-ui-tabs');
wp_enqueue_script('lfc-ui-js', $plugin_url . 'includes/js/tabs-ui.js', array('jquery'));
wp_localize_script( 'lfc-ui-js', 'js_vars', $js_vars) ;
wp_register_style( 'lfc_jquery_admin_css', $plugin_url . 'includes/css/ui.css', false, '1.0.0' );
    wp_enqueue_style( 'lfc_jquery_admin_css' );

//Load scripts and css for jTable
    wp_enqueue_script('jquery-ui-core');
    wp_enqueue_script('lfc-jtable-js', $plugin_url . 'includes/js/jtable/jquery.jtable.js', array('jquery'));
wp_register_style( 'lfc_jtable_css', $plugin_url . 'includes/js/jtable/themes/metro/blue/jtable.css', false, '1.0.0' );
    wp_enqueue_style( 'lfc_jtable_css' );

    //Load main jQuery file
wp_enqueue_script('lfc-process-js', $plugin_url . 'includes/js/process.js', array('jquery'));

}
add_action('admin_enqueue_scripts', 'lfc_load_scripts');
根据jTable.org页面上的说明,这是jQuery

$('#FighterTableContainer').jtable({
        title: 'Table of people',
        actions: {
            listAction: '/GettingStarted/PersonList',
            createAction: '/GettingStarted/CreatePerson',
            updateAction: '/GettingStarted/UpdatePerson',
            deleteAction: '/GettingStarted/DeletePerson'
        },            
        fields: {
            PersonId: {
                key: true,
                list: false
            },
            Name: {
                title: 'Author Name',
                width: '40%'
            },
            Age: {
                title: 'Age',
                width: '20%'
            },
            RecordDate: {
                title: 'Record date',
                width: '30%',
                type: 'date',
                create: false,
                edit: false
            }
        }
});

我在一个虚拟插件中测试了jTable,它显示了一个空白表,其中包含声明的字段Name、Age和RecordDate

代码的问题:

1.下列各项:

wp_enqueue_script( 'jquery-ui-tabs' );
wp_enqueue_script( 'lfc-ui-js', $plugin_url . 'includes/js/tabs-ui.js', array('jquery'));
可声明为:

wp_enqueue_script(
    'lfc-ui-js', 
    $plugin_url . 'includes/js/tabs-ui.js', 
    array( 'jquery', 'jquery-ui-tabs' ) 
);
脚本“lfcjtablejs”也是如此。也许,带代码的那个需要排队

2用document.ready包装代码,如下所示:

jQuery(document).ready(function($) {   
    $('#FighterTableContainer').jtable({
        // rest of the code
    });
});