Author Topic: Redo issue and New row issues  (Read 2802 times)

rgorantla

  • Pro Deluxe
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Redo issue and New row issues
« on: October 16, 2014, 12:06:37 am »
Please take a look at the fiddle :

http://jsfiddle.net/rgorantla/Ljd57c1k/1/

Try adding few rows and do undo - until you have no rows

Now click on redo - you will receive an error "Cannot read property '0' of undefined "

Something when you click on add new row.

Can you help me on what am i doing wrong?


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6122
    • View Profile
Re: Redo issue and New row issues
« Reply #1 on: October 16, 2014, 12:58:47 am »
Error is being thrown because ui.rowIndx is undefined in change event.

Corrected one:  http://jsfiddle.net/paramquery/ytq36uox/ after commenting out the change event.

One way to find the cause of such errors is to use pqgrid.dev.js while development and check the call stack when error is thrown.

rgorantla

  • Pro Deluxe
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Re: Redo issue and New row issues
« Reply #2 on: October 16, 2014, 02:05:10 am »
the problem was i am refreshing the row in change event too : $(this).pqGrid('refreshRow', { rowIndx: ui.rowIndx });
commented that out and it is working as expected