Author Topic: updateList not working  (Read 4848 times)

nuno.nogueira

  • Pro Economy
  • Jr. Member
  • *
  • Posts: 95
    • View Profile
updateList not working
« 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

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: updateList not working
« Reply #1 on: February 07, 2014, 08:25:59 am »
It's because recIndx (dataIndx of primary key of the records) is missing from your dataModel

nuno.nogueira

  • Pro Economy
  • Jr. Member
  • *
  • Posts: 95
    • View Profile
Re: updateList not working
« Reply #2 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?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: updateList not working
« Reply #3 on: February 07, 2014, 03:21:58 pm »
yes you can hide the primary key column.

nuno.nogueira

  • Pro Economy
  • Jr. Member
  • *
  • Posts: 95
    • View Profile
Re: updateList not working
« Reply #4 on: February 07, 2014, 03:30:59 pm »
Ok, I've got it working, thanks!

 :D

nuno.nogueira

  • Pro Economy
  • Jr. Member
  • *
  • Posts: 95
    • View Profile
Re: updateList not working
« Reply #5 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.

nuno.nogueira

  • Pro Economy
  • Jr. Member
  • *
  • Posts: 95
    • View Profile
Re: updateList not working
« Reply #6 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"