netsam
August 10, 2014, 9:45am
#1
Hi, I want to put in menu a to select a file to load. I have this code;
toolbar.xml
<?xml version="1.0"?>
<toolbar>
<item id="newContact" type="button" text="Aggiungi" img="add_contact.gif" imgdis="add_contact_dis.gif"/>
<item id="delContact" type="button" text="Delete" img="delete_contact.gif" imgdis="delete_contact_dis.gif"/>
<item id="sep01" type="separator"/>
<item id="openFolder" type="button" text="Apri archivio" img="open_folder.png" imgdis="open_folder.png"/>
<item id="sep02" type="separator"/>
<item id="help" type="button" text="Help"/>
</toolbar>
index.html
toolbar.attachEvent("onclick",function(id){
if(id=="openFolder"){
// Code here
};
Thanks for your help
Darya
August 11, 2014, 2:02pm
#2
Hi
You can try the next code sample:
[code]
Integration with dhtmlxAccordion
html,body {
width: 100%;
height: 100%;
margin-top: 10px;
}
.dhxform_obj_dhx_skyblue .dhxform_textarea {
border: none !important;
}
.dhxform_obj_dhx_skyblue div.dhxform_item_label_left {
padding-top: 0;
}
.dhxform_obj_dhx_skyblue div.dhxform_item_label_left div.dhxform_label {
padding: 0;
}
[/code]
Darya
August 11, 2014, 2:06pm
#3
Plus you just need to correct form’s CSS a little
netsam
August 12, 2014, 11:50am
#4
Thanks, now I have problem with css. I’d like to have only one button and a image on left (“Apri archivio” button is an example), like the other toolbar’s buttons.
The link of the demo is:
dentalopen.altervista.org/
Darya
August 13, 2014, 12:57pm
#5
If your case will be more easier to use the next implementation:
[code]myToolbar = new dhtmlXToolbarObject({
parent: “toolbarObj”,
icons_path: “…/common/imgs/”
});
myToolbar.addButton(“upload”, 0, “Upload file”);
formData = [
{type: “fieldset”, label: “Uploader”, list:[
{
type: “upload”,
name: “myFiles”,
autoStart: true,
inputWidth: 330,
url: “…/dhtmlxForm/07_uploader/php/dhtmlxform_item_upload.php”,
_swfLogs: “enabled”,
swfPath: “uploader.swf”,
swfUrl: “…/dhtmlxForm/07_uploader/php/dhtmlxform_item_upload.php”}
]}
];
myForm = new dhtmlXForm(“formObject”, formData);
myToolbar.attachEvent("onClick", function(id){
if(id=="upload"){
document.getElementsByClassName("button_browse")[0].click();
}
})
myForm.attachEvent("onUploadComplete",function(count){
alert("file is loaded")
});[/code]
netsam
August 16, 2014, 12:59pm
#6
Thank you very much. But I’ve problem using this implementation. Could you modify my index.html because I tried but It doesn’t work.
Darya
August 18, 2014, 11:57am
#7
Could you attach a demo, please? We wil fix it, test it and send you back.
docs.dhtmlx.com/auxiliary_docs__ … pport.html
It is quite complicated to fix your index without checking
Darya
August 18, 2014, 1:12pm
#8
Sorry, but what exactly problems do you have with our suggested one?
netsam
August 18, 2014, 9:38pm
#9
Here my demo. I can’t explain the error. I didn’t understand how to use the formData,
formData = [
{type: "fieldset", label: "Uploader", list:[
{
type: "upload",
name: "myFiles",
autoStart: true,
inputWidth: 330,
url: "../dhtmlxForm/07_uploader/php/dhtmlxform_item_upload.php",
_swfLogs: "enabled",
swfPath: "uploader.swf",
swfUrl: "../dhtmlxForm/07_uploader/php/dhtmlxform_item_upload.php"}
]}
];
what is formObject tag,
myForm = new dhtmlXForm("formObject", formData);
and what the next part of code does:
toolbar.attachEvent("onClick", function(id){
if(id=="upload"){
document.getElementsByClassName("button_browse")[0].click();
}
})
Thanks
my_demo.rar (730 KB)
Darya
August 19, 2014, 1:23pm
#10
Changed your demo a little
Check the attachment
my_demo_updated.rar (733 KB)
netsam
August 24, 2014, 7:09pm
#11
Thanks a lot… Now it’s ok.