Question

I am using CodeIgniter and DHTMLX to build my system. When my site first loads it show the DHTMLXGrid with all the data from the DB. And when I click on a record and press edit button, it will show the Formlayout.

In my form first field is description and then a checkbox which will enable few other select boxes. If i didn't change the checkbox status data won't get save in the DB. I have no idea what is wrong in my code. I am new to this. Any help would be highly appreciated.

workbench.js

if(buttonid=='save') { 

    eval(formSaveCallback);

    myFormbar.validate();

    if (defFrmSaveHandling) {

       dhxLayout.cells('b').collapse();

       search.grid.updateFromXML(search.grid.xmlLoader.filePath,true,true);

    }
}

datalibrary.js

function Save(){

    addForm.send(layoutBench.formDataUrl+'add/', "post", function(loader, response){ 

       if (debug) console.log('Save return code is :-',response);

       if(response==1) {

            $('#info').fadeIn();

            $('#info').html('Data is saved successfully');    

            $('#info').fadeOut(3000);

       } 
   });
}

My controller and model works fine. I think the issue is because of the blur is not fired when I do not click on any other controls after adding the description may be if I can give a delay and enable the save buton it will work. But I don't no how to do that. Any help regarding the matter? Thanx.

Was it helpful?

Solution

I come up withe the answer to this. It is that I have to call the blur function at the beginning of the save function.

function Save(){

     addForm.getInput("description").blur();
     //rest of the code

}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top