Hi all.
I need help for integration in scheduler the dhtmlxcombo with autosuggestion.
Thank you all.
Thank you for answer.
I have try:
scheduler.form_blocks[“comboselect”]={
render:function(sns){
var html="
return html;
},
set_value:function(){
var z=new dhtmlXCombo(“combo_zone”,“clienti”,200);
z.enableFilteringMode(true,“php/clienti.php”,true);
z.loadXML(“php/clienti.php”);
}},
php/clienti.php is the file where i get the value from DB
in lightbox section:
{name:“clienti”, height:60, type:“comboselect”, map_to:“cliente”},
When I open the lightbox the combobox appears normaly but don’t get the value from my file php/clienti.php.
I have also verify the xml output of php/clienti.php and work fine.
Can you help me ?
Thank you very much
As far as it was initialized - it works as normal combo.
Can you try to make a separate page , with single combo on the page, and test with the same data feed.
In separate page work fine and very well, in my lightbox don’t work, strange!
Any suggestion?
Thank you.
Hi.
I see an error:
when i try only for test insert manually a name in combobox and try save for test, return an error:
‘get_value’ is null or isn’t a object in dhtmlxscheduler.js at line 3365.
probably miss some value?
Can you help me?
Thank you very much.
Hi.
I have try another test:
If I insert the first letter and select down arrow of my keybord the combo list the corrispondent row. Means that my file php/clienti.php work fine.
Hi Stanislav, Thank you very much.
Yor example work fine ,but the suggestion function (when i insert the first letter) don’t work.
Work very well with this next code and the your css class .dhx_combo_list{z-index:11000;}.
The code bring from dhtmlxcombo forum:
scheduler.form_blocks[“combo”]={
render:function(sns){
var height=(sns.height||“23”)+“px”;
var html="
return html;
},
set_value:function(node,value,ev){
if (!node.combo){
node.combo = new dhtmlXCombo(node.id,“dummy”,“553px”);
node.combo.enableFilteringMode(true);
node.combo.loadXML(node.getAttribute(“data”),function(){
node.combo.setComboValue(value||"");
});
return;
}
node.combo.setComboValue(value||"");
},
get_value:function(node,ev){
return node.combo.getActualValue();
},
focus:function(node){
node.combo.DOMelem_input.focus();
}
}
I don’t understand the difference why work.
The big problem was also css.
Thank you very much for your example, it solved my problem.
Hi, can I view 3 different combobox on the same line in lightbox?
Thank you.
You can use the same code, but add 3 div container with different ID and call init code 3 times for each container
Code of set|get methods need to be altered to get|set data directly from event object.
Sorry for reopening this thread, but when i got it right, sondra asked for three seperate combo fields within one line, so not via 3 divs!
In my example i got one section with three input fields, either.
In detail i got it like that:
[code]scheduler.form_blocks[“my_editor”]={
render:function(sns){
return "<div class='dhx_cal_ltext' style='height:83px;'><table border='0' width='100%' cellpadding='2'><tr><td><div>Nachname</div><input type='text' style='width:150px;' id='combo_zone'></td><td><div>Vorname</div><input type='text' style='width:150px;'></td><td><div>Telefon</div><input type='text' style='width:150px;'></td></tr><tr><td colspan='3'><div>Bemerkung</div><input type='text' style='width:524px'></td></tr></table><input type='hidden'></div><input type='hidden'></div>";
},
set_value:function(node,value,ev){
var inps = node.getElementsByTagName("INPUT");
inps[0].value=ev.nachname||"";
inps[1].value=ev.vorname||"";
inps[2].value=ev.telefon||"";
inps[3].value=ev.bemerkung||"";
inps[4].value=ev.user||"praxis";
//inps[5].value=ev.text||"";
},
get_value:function(node,ev){
var inps = node.getElementsByTagName("INPUT");
ev.nachname= inps[0].value;
ev.vorname= inps[1].value;
ev.telefon= inps[2].value;
ev.bemerkung= inps[3].value;
ev.user= inps[4].value;
//ev.text= inps[5].value;
},
focus:function(node){
var inps = node.getElementsByTagName("INPUT");
inps[0].focus();
}
}[/code]
scheduler.config.lightbox.sections=[
{ name:"description", height:83, map_to:"text", type:"my_editor" , focus:true},
{ name:"art", height:21, type:"my_select", map_to:"art", options:[
{key:"sprechstunde_neurologisch", label:"Sprechstunde (neurologisch)"},
{key:"sprechstunde_psychatrisch", label:"Sprechstunde (psychatrisch)"},
{key:"eeg", label:"EEG"},
{key:"nlg", label:"NLG"},
{key:"uU", label:"u.U."},
{key:"gt", label:"GT"},
{key:"mmpi", label:"MMPI"},
{key:"rehacom", label:"RehaCom"},
{key:"duplex", label:"Duplex"},
{key:"pt", label:"PT"}
]},
{name:"event_type", height:21, type:"select", map_to:"event_type", options:sectionals},
{ name:"time", height:72, type:"time", map_to:"auto"}
]
I can’t bring the attached example to work withing “my_editor”, because it depends on a seperate div… I am very happy to got it working right now, but any changes crushes everything for me… End of latin, like we germans says
My skills are roughly bit more than basics, but for this i bit on granit… Would be happy for any suggestions!!!
Perhaps i just need to know the way to call the node-names right.
Cause i get it the combo-box from sample to work within my “my-editor” section, but i don’t know ho to adress the other ones (i tried to name the first (nachname) “id=combo_box” and the tried call it via node.combo_box, but of course doesn’t work for me…
I don’t understand, why node.combo adresses the combo-box! It got no attribute like that…
Furthermore i see, that i got a problem: I am using text-boxes for my input… i have to change the whole thing, right? Could you provide me help for it?
If you want to have a combo, just replace
with
and in set_value
if (!node.combo){
node.combo = new dhtmlXCombo("combo_zone");
}
node.combo.setComboValue(ev.nachname||"");
Doesn’t work for me.
I need to show more than just one combo.
Now i got
[code] set_value:function(node,value,ev){
if (!node.combo){
node.combo = new dhtmlXCombo(“combo_zone”);
node.combo = new dhtmlXCombo(node.id,“dummy”,“150px”);
node.combo.enableFilteringMode(true, “php/nachname.php”, true, true);
node.combo.loadXML(“php/nachname.php”,function(){
node.combo.setComboValue(value||"");
});
return;
}
node.combo.setComboValue(ev.nachname||"");
node.combo.setComboValue(value||"");
},[/code]
and my rendering is like
[code] render:function(sns){
var html=“
Nachname
|
Vorname |
Telefon |
Bemerkung |
return html;
},[/code]
Both combo-boxes doesn’t appear, just empty spaces
Without the second one included it works with the first one
I still think i don’t know how to adress them correctly…
Check the attached ( ignore errors - they are because of missed server feeds )
1282317615.zip (51.8 KB)
This works really good… I have to say thank youz again for this snippet.
I saw, that you implemented in 2.3 an “easier way to implement combo boxes”…
I will check it out
There is only one issue:
When i open up the lightbox the first time (via edit mode) everything works fine, but if i open up again, there are the combobox from first request beqoned the one form the actual one…
Is this understandable?
Also the correct values are not given
This seems to be a problem in the order of the inputs… i will check it…
Have a try at
[code] scheduler.form_blocks[“my_editor”]={
render:function(sns){
return "<div class='dhx_cal_ltext' style='height:102px;'><table border='0' width='100%' cellpadding='2'><tr><td><div>Nachname</div><div id='combo_zone_nachname' style='width:150px;'></div></td><td><div>Vorname</div><div id='combo_zone_vorname' style='width:150px;'></td><td><div>Telefon</div><input type='text' style='width:150px;'></td></tr><tr><td colspan='3'><div>Bemerkung</div><input type='text' style='width:524px'></td></tr></table><input type='hidden'></div><input type='hidden'></div>";
},
set_value:function(node,value,ev){
var inps = node.getElementsByTagName("INPUT");
//inps[0].value=ev.nachname||"";
//inps[1].value=ev.vorname||"";
//inps[2].value=ev.telefon||"";
//inps[3].value=ev.bemerkung||"";
//inps[4].value=ev.user||"praxis";
//inps[5].value=ev.text||"";
inps[0].value=ev.telefon||"";
inps[1].value=ev.bemerkung||"";
inps[2].value=ev.user||"praxis";
if (!node.combos){
var comboA = new dhtmlXCombo("combo_zone_nachname","dummy","150px");
comboA.enableFilteringMode(true, "php/nachname.php", true, true);
comboA.loadXML("php/nachname.php",function(){
comboA.setComboValue(ev.nachname||"");
});
var comboB = new dhtmlXCombo("combo_zone_vorname","dummy","150px");
comboB.enableFilteringMode(true, "php/vorname.php", true, true);
comboB.loadXML("php/vorname.php",function(){
comboB.setComboValue(ev.vorname||"");
});
return;
}
node.combo.setComboValue(ev.nachname||"");
},
get_value:function(node,ev){
var inps = node.getElementsByTagName("INPUT");
ev.nachname= inps[0].value;
ev.vorname= inps[1].value;
ev.telefon= inps[2].value;
ev.bemerkung= inps[3].value;
ev.user= inps[4].value;
//ev.text= inps[5].value;
},
focus:function(node){
var inps = node.getElementsByTagName("INPUT");
inps[0].focus();
}
}
[/code]
I can provide any data you need!
Mayor problem seems to be the recreation of new combobox, but secondary, the values SETTING is wrong (getting seems to be working fine).
The logs says the following on creating event:
====================================
Log started, 25/08/2010 02:08:36
====================================
DataProcessor object initialized
1282745749895_start_date => 2010-08-25 07:30
1282745749895_end_date => 2010-08-25 07:45
1282745749895_text => undefined
1282745749895_id => 1282745749895
1282745749895_nachname => ***NACHNAME***
1282745749895_vorname => ***NACHNAME***
1282745749895_telefon => true
1282745749895_bemerkung => ***VORNAME***
1282745749895_user => ***VORNAME***
1282745749895_art => sprechstunde_neurologisch
1282745749895_event_type => 0
1282745749895_!nativeeditor_status => inserted
ids => 1282745749895
Row data [1282745749895]
start_date => 2010-08-25 07:30
end_date => 2010-08-25 07:45
text => undefined
id => 1282745749895
nachname => ***NACHNAME***
vorname => ***NACHNAME***
telefon => true
bemerkung => ***VORNAME***
user => ***VORNAME***
art => sprechstunde_neurologisch
event_type => 0
!nativeeditor_status => inserted
Incorrect field name used: marked
data
start_date => 2010-08-25 07:30
end_date => 2010-08-25 07:45
text => undefined
id => 1282745749895
nachname => ***NACHNAME***
vorname => ***NACHNAME***
telefon => true
bemerkung => ***VORNAME***
user => ***VORNAME***
art => sprechstunde_neurologisch
event_type => 0
!nativeeditor_status => inserted
INSERT INTO events(start_date,end_date,text,nachname,vorname,telefon,art,bemerkung,event_type,user,marked) VALUES ('2010-08-25 07:30','2010-08-25 07:45','undefined','***NACHNAME***','***NACHNAME***','true','sprechstunde_neurologisch','***VORNAME***','0','***VORNAME***','')
Edit operation finished
0 => action:inserted; sid:1282745749895; tid:3450;
Done in 0.033918142318726s
correctly it should be
INSERT INTO events(start_date,end_date,text,nachname,vorname,telefon,art,bemerkung,event_type,user,marked) VALUES ('2010-08-25 07:30','2010-08-25 07:45','undefined','***NACHNAME***','***NACHNAME***','***TELEFON***','sprechstunde_neurologisch','***BEMERKUNG***','0','***VORNAME***','')
The filed “marked” is used in my application for marking some event. I am using the scheduler.templates.event_header for this. It is done by ajax code, and is still working, hopefulyl not effecting anything with lightbox here?
change the next
comboB.loadXML("php/vorname.php",function(){
comboB.setComboValue(ev.vorname||"");
});
return;
}
as
comboB.loadXML("php/vorname.php",function(){
comboB.setComboValue(ev.vorname||"");
});
node.combos = true; //added!
return;
}
in set_value
inps[0].value=ev.telefon||"";
in get_value
ev.telefon= inps[2].value;
You are using different inputs for the same property , which is causing the error.