Hi,
I have this agenda and aluno table as follow:
I’m trying to load this into the scheduler and the lightbox, but is not working.
The carregarAlunos.php is working, returning an xml with the right info
[code]<?php
require_once(‘…/…/dao/scheduler/connector/combo_connector.php’);
// Mysql
$dbtype = “MySQL”;
$res=mysql_connect(“localhost”, “root”, “”);
mysql_select_db(“sam”);
$combo = new ComboConnector($res, $dbtype);
$combo->event->attach(“beforeFilter”, “by_id”);
function by_id($filter) {
if (isset($_GET[‘id’]))
$filter->add(“id”, $_GET[‘id’], ‘=’);
}
$combo->dynamic_loading(3);
$combo->render_table(“aluno”,“id”,“nome”);
?>[/code]
The script from index.html:
<script>
function init() {
scheduler.config.xml_date="%Y-%m-%d %H:%i";
scheduler.config.prevent_cache = true;
scheduler.config.details_on_create = true;
scheduler.config.details_on_dblclick = true;
scheduler.locale.labels.section_type = "Aluno:";
scheduler.locale.labels.section_time = "Horário: ";
scheduler.locale.labels.section_description = "Aluno: ";
scheduler.config.event_duration = 45;
var holders = [
{ key: 1, label: 'James' },
{ key: 2, label: 'Alex' },
{ key: 3, label: 'Antony' },
{ key: 4, label: 'Andrew' }
];
scheduler.locale.labels.section_holder = "Holder";
scheduler.config.lightbox.sections=[
//{name:"description", height:130, map_to:"text", type:"textarea" , focus:true},
{ name:"holders", options:holders, map_to:"holders", type:"combo",
image_path:"../../script/scheduler/dhtmlxCombo/imgs/", height:30, filtering:true, script_path: "carregarAlunos.php"},
{name:"type", map_to:"idaluno", type:"select", options:scheduler.serverList("aluno")},
{name:"time", height:72, type:"time", map_to:"auto"}
]
scheduler.config.first_hour=6;
scheduler.init('scheduler_here', new Date(),"day");
scheduler.setLoadMode("day");
scheduler.load("carregarAgenda.php");
var dp = new dataProcessor("carregarAgenda.php");
dp.init(scheduler);
}
</script>
My idea is load the field nome as a combobox into the agenda table.