Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 选择2部分加载数据_Php_Jquery_Ajax_Medoo - Fatal编程技术网

Php 选择2部分加载数据

Php 选择2部分加载数据,php,jquery,ajax,medoo,Php,Jquery,Ajax,Medoo,我正在使用select2插件显示我的下拉数据 我有问题,因为我的下拉菜单select2有18000个数据。 如何使数据部分显示,而不是加载所有数据。我使用Medoo数据库框架。我该怎么做 这是我的源代码 <div class="form-group"> <label for="nama_user"><?php _e('Nama User'); ?></label> <select

我正在使用select2插件显示我的下拉数据

我有问题,因为我的下拉菜单select2有18000个数据。 如何使数据部分显示,而不是加载所有数据。我使用Medoo数据库框架。我该怎么做

这是我的源代码

        <div class="form-group">
            <label for="nama_user"><?php _e('Nama User'); ?></label>
            <select class="form-control select2 select2-hidden-accessible" id="nama_user" name="nama_user" style="width: 100%;" tabindex="-1" aria-hidden="true">
                <option value="0"><?php _e('Nobody'); ?></option>
                <?php foreach ($ldap as $ldap) { ?>
                <option value='<?php echo $ldap['id']; ?>'><?php echo $ldap['nama_user']; ?></option>
                <?php } ?>
            </select>
       </div>
此函数用于使用Medoo调用数据

    case "gemilang/add":
    $contacts = getTable("contacts");
    if($isAdmin) { $assets = getTable("assets"); } else { $assets = getTableFiltered("assets","clientid",$liu['clientid']); }
    $clients = getTable("clients");
    $cabang_gemilang = getTable("cabang_gemilang");
    $ldap = getTable("ldap");
    $admins = getTableFiltered("people","type","admin");
    if($isAdmin) { $users = getTableFiltered("people","type","user"); } else { $users = getTableFiltered("people","type","user","clientid",$liu['clientid']); }
    break;

您可以按照我用来执行数据限制的代码,使用AJAX加载值?延迟:250?您不需要设置数据限制,只需设置“minimumInputLength=3”,这样,当您在selectbox中键入3个字符时。这会给你们所有的比赛结果谢谢jaydp,这超出了我的想象。
    case "gemilang/add":
    $contacts = getTable("contacts");
    if($isAdmin) { $assets = getTable("assets"); } else { $assets = getTableFiltered("assets","clientid",$liu['clientid']); }
    $clients = getTable("clients");
    $cabang_gemilang = getTable("cabang_gemilang");
    $ldap = getTable("ldap");
    $admins = getTableFiltered("people","type","admin");
    if($isAdmin) { $users = getTableFiltered("people","type","user"); } else { $users = getTableFiltered("people","type","user","clientid",$liu['clientid']); }
    break;