Hi,
I use dhtmlx 3.0suite and I have attached a layout toolbar to save the data in my form but when I click the save button only data item that no longer have the focus are taken into account.
If I use buttons that are on my form all data are taken into account.
It seems that when the focus remains on the last modified data are not saved.
To force the registration of all the data I need to finish the last edition of the field by removing the focus manually.
How to save all changes with “myForm.save()” ?
I used the example after, I just added a toolbar and code to save data with toolbar.
//--- Create/Update/Delete operations ---
myForm.attachEvent("onButtonClick", function(id){
if (id=='save'){
myForm.save(); //saves the made changes
}
});
My Save button in toolbar use this code (the last change is not saved)
//-- Toolbar de la page
var dhxToolbar = layout.cells("b").attachToolbar(); // returns toolbar object
dhxToolbar.setIconsPath("menus/imgs/");
dhxToolbar.addButton("sauve", 0, "Sauve", "save.gif", "save_dis.gif");
dhxToolbar.attachEvent("onClick",function(id){
if (id=='sauve'){
//alert("Sauvegarde effectuée.");
myForm.save();
}
});
Thank you for the information.
I tried this new file but does not solve my problem.
I always have to click outside the field for the last change to take account if i use the button on the toolbar and “myForm.save()” function.
Please attach the complete demo that reproduces the problem. Locally form.save() sends data correctly to server regardless whether there was click or not (We tested the form library from viewtopic.php?f=5&t=22544#p72502 post).
Hi,
My form is clearly visible as when I put the focus to another item before saving the data with myForm.save () it works correctly from the toolbar.
The other way is to do an alert (“Save OK”); myForm.save before () and all data is saved as in the code below.
//-- Toolbar de la page
var dhxToolbar = layout.cells("b").attachToolbar(); // returns toolbar object
dhxToolbar.setIconsPath("menus/imgs/");
dhxToolbar.addButton("sauve", 0, "Sauve", "save.gif", "save_dis.gif");
dhxToolbar.attachEvent("onClick",function(id){
if (id=='sauve'){
alert("Sauvegarde effectuée.");
myForm.save();
}
});
Effectively the recommanded file is named dhtmlxform.jsnew2 in my demo but I tried it and I did not get the desired result.
In this second test with this new file I replaced the original file dhtmlxform.js dhxSuite3.0 by the new, I erased the history of the internet explorer and refreshed the page but the problem is the same.
I tried with IE, FF, Chrome but the last modified field is saved only if i click outside the field when I use the button in the toolbox.
I think I have tested under the right conditions but if I’m wrong tell me.
The new file dhtmlxform.js is taken into account by inserting this code or not ?
With this new library the appearance of form buttons is truncated.
Before the addition of the library the buttons in the form were displayed very well why not with the new library ?
Hi,
Thank you for all your replies, adding the new style has corrected the latter problem.
Everything works as desired, the grid, the form and its buttons, the toolbar and buttons, and data backup.
Solved.
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan