ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: nuno.nogueira on February 07, 2014, 12:55:26 am

Title: updateList not working
Post by: nuno.nogueira on February 07, 2014, 12:55:26 am
I'm replicating the demo on "batch editing".

Code: [Select]
var changes = $grid.pqGrid("getChanges", { format: "byVal" }),
                addList = changes.addList,
                updateList = changes.updateList,
                deleteList = changes.deleteList;

addList and deleteList are both working fine. I'm using exactly the same code as per your demo and I can talk to the server and the database.

But, updateList isn't doing anything. I change one of the cells and click the button "Accept Changes" and the conditional below isn't called, why?

Code: [Select]
if (updateList.length) {
            alert("lista autalizada");}

You may see for yourself an example on http://www.portal-gestao.com/youbudgetz.html (http://www.portal-gestao.com/youbudgetz.html)
Title: Re: updateList not working
Post by: paramvir on February 07, 2014, 08:25:59 am
It's because recIndx (dataIndx of primary key of the records) is missing from your dataModel
Title: Re: updateList not working
Post by: nuno.nogueira on February 07, 2014, 03:15:31 pm
Ok, I'll include it and hide it from the view, I guess it will still work like that, right?
Title: Re: updateList not working
Post by: paramvir on February 07, 2014, 03:21:58 pm
yes you can hide the primary key column.
Title: Re: updateList not working
Post by: nuno.nogueira on February 07, 2014, 03:30:59 pm
Ok, I've got it working, thanks!

 :D
Title: Re: updateList not working
Post by: nuno.nogueira on February 07, 2014, 05:58:48 pm
Update and delete queries are working, however they never reach the "complete" status. The "loading" gif doesn't go away and the tabe doesn't refresh.
Title: Re: updateList not working
Post by: nuno.nogueira on February 07, 2014, 09:34:32 pm
I found the answer myself: PHP just has to echo something back in order to make the statys "complete"