Dhtmlx加载数据到下拉菜单中


Dhtmlx load data into dropdown

我使用Dhtmlx调度器,它工作得很好,但是我有一些自定义LightBox的问题。我添加了一个下拉列表,我想从我的mysql数据库使用json加载数据。这是我的代码

require_once('codebase/connector/scheduler_connector.php');
require("codebase/connector/db_mysqli.php");    
$mysqli = new mysqli("$db", "$dbn", "$pw",  "$tb"); 

$listcollab = new OptionsConnector($mysqli, "MySQLi");
$listcollab->render_table("Operator","ID","ID(value),Name(label)");

$scheduler = new JSONSchedulerConnector($mysqli, "MySQLi");
$scheduler->set_options("coll", $listcollab); //without this scheduler charge data
$scheduler->render_table("Agenda","ID","AppStart,AppEnd,Cliente,Servizio");

客户端

var list = scheduler.serverList("coll");    
    function init() {
        scheduler.config.xml_date = "%Y-%m-%d %H:%i";
        scheduler.config.prevent_cache = true;
        scheduler.config.first_hour = 8;
        scheduler.config.last_hour = 21;
        scheduler.config.limit_time_select = true;
        scheduler.locale.labels.section_location = "Servizio";
        scheduler.locale.labels.section_select = 'Seleziona';
        scheduler.config.details_on_create = true;
        scheduler.config.details_on_dblclick = true;
        scheduler.config.prevent_cache = true;
        scheduler.config.lightbox.sections = [
            {name:"CLIENTE", height:90, map_to:"Cliente", type:"textarea" , focus:true},
            {name:"Servizio", height:43, type:"textarea", map_to:"Servizio" },
            {name:"select", height:40, map_to:"ID", type:"select", options:scheduler.serverList(list)},
            {name:"Collaboratore", height:43, type:"textarea", map_to:"auto" },
            {name:"Orario", height:72, type:"time", map_to:"auto"}
        ];
        scheduler.init('scheduler_here', new Date(2015, 9, 23), "week");
        scheduler.load("connessione.php", 'json');
        var dp = new dataProcessor("connessione.php");
        dp.init(scheduler);

有人可以帮助我从数据库使用php获得数据吗?提前感谢

你在服务器端使用什么?如果后端使用PHP和dhtmlxConnector,本文应该会有所帮助。

如果你已经手动实现了数据加载,那么你需要这两个方法:http://docs.dhtmlx.com/scheduler/api__scheduler_serverlist.htmlhttp://docs.dhtmlx.com/scheduler/api__scheduler_updatecollection.html

常见的方法如下-使用调度程序将选项声明为命名集合。serverList方法,然后使用调度程序更新。updateCollection当数据从服务器加载时