So I have a very very weird bug and I cannot find the origin. I have a grid with a window and a form attached to it. It all works, however, every 2nd insert with the form UPDATES the last inserted record instead of inserting!
This is my form that gets loaded:
[code] var w1, myForm;
dhxWins = new dhtmlXWindows();
dhxWins.attachViewportTo("gridbox");
// ACTION WINDOW
w1 = dhxWins.createWindow("w1", 20, 30, 460, 410);
w1.attachEvent("onClose", function(){
w1.hide();
$('div#gridbox').css('opacity','1');
});
w1.center();
w1.hide();
//ATTACH FORM TO ACTION WINDOW
myForm = w1.attachForm();
myForm.loadStruct("<?php echo bloginfo('template_url'); ?>/jtc/task_action_formcontents.json");
var dp_f = new dataProcessor("<?php echo bloginfo('template_url'); ?>/jtc/task_action_conn.php?action=insert");
dp_f.init(myForm);
myForm.attachEvent("onButtonClick",function(buttonID){
if(buttonID=="submit"){
myForm.save();//no params needed.It uses url that you passed to dataprocessor
myForm.clear();
mygrid.updateFromXML("<?php echo bloginfo('template_url'); ?>/jtc/task_manager_conn.php");
w1.hide();
//doOnLoad();
}
});
[/code]
I use the “action=insert” at the dataProcessor.
Here’s my php-connector:
$form = new FormConnector($conn);
$form->enable_log("log.txt");
$form->render_table("wp_task_actions","id","last_completion_percentage,completion_percentage,duration_hours,taskaction_notes,taskaction_user,id_task,created_taskaction");
BTW, I cannot find the log files anywhere, I think my wordpress framework are blocking them from being saved…
Any ideas?