Author Topic: column editor not firing pqgridcellbeforesave?  (Read 4704 times)

jtflint

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 4
    • View Profile
column editor not firing pqgridcellbeforesave?
« on: November 01, 2013, 01:12:54 pm »
I've managed to get regular textarea updates working fine with editor and editModel, with pqgridcellbeforesave, working fine.
My difficulty is getting pqgridcellbeforesave, when specifying a different editor (like 'select', or 'checkbox' under colModel.  Im assuming there's a simple way to do this, that Im missing?
Thanks in advance.

Here's some code...

var colModel[
    {
      title: 'Auto'
      ,sortable: false
      ,Width: 70
      ,dataType: 'bool'
      ,dataIndx: 'auto'
      ,align: 'center'
      ,editor { type: 'checkbox' , cls: 'checkBoxColumn'}
     }
     ...
];
...
var obj {
    ,editable: true
    ,editor: { type: "textbox" }
    ,editModel: {
      clicksToEdit: '1', 
      saveKey: $.ui.keyCode.ENTER, // or 13. http://api.jqueryui.com/jQuery.ui.keyCode/
      select: false,
      keyUpDown: false,   
      cellBorderWidth: 0
    }
...
};

var $grid = $("#grid").pqGrid(obj);


$grid.on( "pqgridcellbeforesave", function( evt, ui ) {
...
$.ajax(...) //This works right, when this event is fired.
});

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: column editor not firing pqgridcellbeforesave?
« Reply #1 on: November 01, 2013, 09:12:24 pm »
I don't find anything wrong with your posted code.

Did you press enter or tab after changing value in select list or checkbox.

Could you provide more information about it like when does the event fire or does the event not fire at all. You can put alert or a breakpoint in your event to find out whether that is a problem in the event firing or $.ajax call.





« Last Edit: November 01, 2013, 09:53:26 pm by paramquery »

jtflint

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: column editor not firing pqgridcellbeforesave?
« Reply #2 on: November 04, 2013, 04:23:29 am »
hmm, well, I think I have it working by making the following change.
I changed the pqgridcellbeforesave to pqgridcellsave, and that seems to fire for both kinds.
Thanks.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: column editor not firing pqgridcellbeforesave?
« Reply #3 on: November 05, 2013, 09:20:37 am »
walter

pqgridcellbeforesave fires before the cell is saved and pqgridcellsave after it. Sooner or later you would need pqgridcellbeforesave for validations.

You may post your relevant grid code so that the issue can be reproduced.