jQWidgets Forums

Forum Replies Created

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

  • wureka
    Participant

    Dear Dimitar,
    Thank you for your solution. That’s really cool!


    wureka
    Participant

    Hi, Mariya,
    Thank you for your suggestion. I did follow the demos you mentioned, including spreadsheet, create-move-update-data, and cellediting.
    Well, currently the problem I meet is that because my datasource is a remote JSON datasource as below:

    
            projectSource = {
                datatype:'json',
                unboundmode: true,
                url:'<g:createLink controller="api" action="getProjects"/>', // this is the syntax of Grails.
                type:'GET',
                async:true,
                dataFields:[
                    {name:'projectId', type:'number'},
                    {name:'customerId', type:'number'},
                    {name:'customerName', type:'string'},
                    {name:'projectName', type:'string'},
                    {name:'projectStatus', type:'string'},
                    {name:'projectType', type:'string'},
                    {name:'projectCode', type:'string'},
                    {name:'newestJournal', type:'string'},
                    {name:'journalDate', type:'string'},
                    {name:'spms', type:'string'},
                    {name:'ams', type:'string'}
                ],
                updaterow: function(rowid, rowdata, commit) {
                    console.log("updaterow():rowid:"+rowid+",commit:"+commit+",rowdata:" + JSON.stringify(rowdata));
                    commit(true);
                },
                addrow: function (rowid, rowdata, position, commit) {
                    commit(true);
                },
                deleterow: function (rowid, commit) {
                    commit(true);
                },
                updaterow: function (rowid, newdata, commit) {
                    commit(true);
                }
            };
            projectDataAdapter = new $.jqx.dataAdapter(projectSource, {
                loadError: function(jqXXHR, status, error) {
                    console.error("projectDataAdapter().loadError:status:"+status+", error:" + error);
    
                    //alert("Error when loading data:" + error);
                }
            });
    

    Due to the business requirement, I can not synchronize the server when I add a new row in jqxGrid.
    And the problem is that just after I add a new row to the jqxGrid element, it automatically reloads data from the server.
    And that action makes the new added row disappear.

    The possible solution I can think is, is it possible to disable the auto-reloading data of jqxGrid after adding a new row to the jqxGrid element?

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