Hello,
First of all, sorry for my english.
Sorry but i dont understand your explain, it’s my first week with dhtmlx and im following this sample:
scheduler\samples\02_customization\18_combo_select_from_db.html.
This sample insert a combo in the lightbox. This combo gets de names of a mysql table with the name of some countries. I just need to get the name of the country and WRITE it in the ev.text of the ligthbox to save it in the field event_name of my table.
Sorry but im starting with dtmlx
Thanks.
[code]
<script src="../../codebase/dhtmlxscheduler.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="../../codebase/dhtmlxscheduler.css" type="text/css" media="screen" title="no title"
charset="utf-8">
<link rel="stylesheet" href="../../codebase/ext/dhtmlxscheduler_ext.css" type="text/css" media="screen"
title="no title" charset="utf-8">
<script src="../../codebase/ext/dhtmlxscheduler_editors.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="../../samples/common/dhtmlxCombo/dhtmlxcombo.css">
<script src="../../samples/common/dhtmlxCombo/dhtmlxcombo.js"></script>
<style type="text/css" media="screen">
html, body {
margin: 0px;
padding: 0px;
height: 100%;
overflow: hidden;
}
</style>
<script type="text/javascript" charset="utf-8">
function init() {
// SAVING THE NAME OF THE COUNTRY ( COMBO ) IN THE TEXT FIELD
scheduler.attachEvent("onEventChanged", function(event_id,data,event_object){
var ev = scheduler.getEvent(event_id);
var country_name = data.combo_select; // ¡¡¡ OBTAINS THE ID COUNTRY, NOT THE NAME. !!"
ev.text = country_name; // WRITE THE ID COUNTRY, NOT THE NAME.
scheduler.updateEvent(event_id);
dp.setUpdated(event_id, true, "updated");
});
// END MY CODE
scheduler.config.multi_day = true;
scheduler.config.event_duration = 30;
scheduler.config.auto_end_date = true;
scheduler.config.details_on_create = true;
scheduler.config.details_on_dblclick = true;
scheduler.locale.labels.section_country = "Select country:";
var snacks = [
{ key: 5, label: 'Pineapple' },
{ key: 6, label: 'Chocolate' },
{ key: 7, label: 'Chips' },
{ key: 8, label: 'Apple pie' }
];
scheduler.config.lightbox.sections = [
{ name: "description", height: 50, map_to: "text", type: "textarea", focus: true },
{ name: "country", options: snacks, map_to: "combo_select", type: "combo", image_path: "../../samples/common/dhtmlxCombo/imgs/", filtering: true, script_path: "data/combo_select.php", cache: false },
{ name: "time", height: 72, type: "time", map_to: "auto"}
];
scheduler.config.xml_date = "%Y-%m-%d %H:%i";
scheduler.init('scheduler_here', new Date(2012, 3, 3), "timeline");
// mycode. Call another table to get an save the events of timeline
scheduler.load("./datapg/typespg.php");
var dp = new dataProcessor("datapg/typespg.php");
dp.init(scheduler);
// end mycode
}
</script>
[/code]