jQWidgets Forums

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts

  • juamar100
    Participant

    Sorry, better use $(“#jqxgrid”).jqxGrid(‘updatebounddata’) instead of dataAdapter.dataBind(). The second approach gave me some problems with everpresentrow.


    juamar100
    Participant

    All right! Checking again this information you linked make me realise of the dataBind function, which partially solved my issue. I think The real solution will be refactor my code using ajax synchronous request… We both know my code is a mess ;D…

    Just in case someone has the same problem, i will leave here my updateRow function updated. Look at the ajax block:

    updaterow: function (rowid, rowdata, commit)
                    {
                        //console.log(rowdata);
                        var output = rowdata;
                            
                        for (property in output) {
                            if (output[property] instanceof Date && schema.properties[property].format === "time") {
                                output[property] = output[property].getHours() + ":" + output[property].getMinutes();
                                //console.log('hola');
                            }
                            if (output[property] instanceof Date && schema.properties[property].format === "date")
                            {
                                output[property] = output[property].getFullYear() + "-" + (output[property].getMonth() + 1) + '-' + output[property].getDate();
                            }
                        }
    
                        //console.log(event.args.row);
                        //console.log(output);
                        //console.log(rowdata);
                    
                        var token = $('input[name="__RequestVerificationToken"]').val();
    
                        $.ajax({
                            url: "/api/" + entity + "/" + rowdata.uid,
                            cache: false,
                            method: "put",
                            data: JSON.stringify(rowdata),
                            processData: false,
                            headers: {
                                "RequestVerificationToken": token,
                                "Content-type": "Application/json"
                            },
                            success: function () {
                                console.log("Okey dokey!");
                                commit(true);
                                dataAdapter.dataBind();
                            },
                            error: function () {
                                alert("El dato no se ha actualizado correctamente");
                                dataAdapter.dataBind();
                            }
                        });
                    }

    Thanks Hristo!


    juamar100
    Participant

    By the way, it will be better if you show all your HTML/JSP to see how you are calling your scripts.


    juamar100
    Participant

    Let me try to help, since i don’t know exactly what is the problem.

    Hmmm… Why are you using . on your url ‘./JSP/Home2.jsp’? better if you use relative url from httproot folder (something like ‘/JSP/home2.jsp’).
    check also that you are using comas (,) at the end of objects. The last property never take coma. Your are doing this wrong in columns object within array and in mastersource.

    For example, masterSource will be:

    var masterSource = {
                            datafields : [ {
                                name : 'JC_ID'
                            }, {
                                name : 'JC_Name'
                            }, {
                                name : 'JC_Code'
                            }, {
                                name : 'JC_Description'
                            }, {
                                name : 'JC_TriggerExecution'
                            }, {
                                name : 'JC_CreationTime'
                            }, {
                                name : 'JC_ModificationTime'
                            } ],
                            id : 'JC_ID',
                            autoheight : true,
                            datatype : "json",
                            async : false,
                            url : './JSP/Home2.jsp' //no coma here! ;D
                        };
    

    Did you tried accessing this application with no VPNs, proxys, or firewalls in the middle? maybe there is some configuration in your VPN, network, etc, that is bothering. There can be many factors.
    You can try access your application within any localnetwork, accessing it by IP:port (and of course, netbeans and Glassfish or tomcat listening) from another computer at home or some network you can handle to see what can be the problem. Or even better, you can try access it from internet using no-ip, or similar service.

    Hope it helps, keep me updated!


    juamar100
    Participant

    Sorry, title may be ‘rowdata changing even before statement to do so’.

Viewing 5 posts - 1 through 5 (of 5 total)