| View previous topic :: View next topic |
| Author |
Message |
racecar789
Joined: 21 Sep 2006 Posts: 28
|
Posted: Sat Dec 23, 2006 6:23 pm Post subject: Grid 3.41 Insert & Delete Bug |
|
|
When clicked on the last row, if a new row is then added the grid will add two rows to bottom of the grid (instead of one). Then, if one of the new rows is deleted it will not only delete both of the fresh rows, but also the last original row as well.
Here is example (screenshots from demo page at http://nitobi.com/products/grid/demos/basic/index.htm )
Step 1, Select Last Record: http://us.f13.yahoofs.com/bc/458c5c00_246b/bc/Nitobi+Files/Nitobi-1+Normal+Grid.jpg?bfhcXjFBbgXdszri
-Notice Lindsay is last record and that we selected her.
Step 2, Add record: http://us.f13.yahoofs.com/bc/458c5c00_246b/bc/Nitobi+Files/Nitobi-2+Added+Record.jpg?bfhcXjFBzH2Yo9Cd
-Notice two rows are added when the add record button was clicked only once.
Step 3, Click on New Record: http://us.f13.yahoofs.com/bc/458c5c00_246b/bc/Nitobi+Files/Nitobi-3+Now+click+here.jpg?bfhcXjFBljnY6C_r
-Click here before clicking delete record.
Step 4, After Deletion: http://us.f13.yahoofs.com/bc/458c5c00_246b/bc/Nitobi+Files/Nitobi-4+After+Delete+3+records+removed.jpg?bfhcXjFBNeq5_NkY
-Notice both Linday and the two new rows are removed from the one delete click.
Note: this is mostly a cosmetic bug. It doesn't fire multiple grid insert/delete events or anything like that. Also, the very bottom new row is not clickable so it looks like a row is there but there is nothing. Finally, Grid 3.23 does not have this problem.
If you could address this it would be helpful. Thank you. |
|
| Back to top |
|
 |
mike_nitobi
Joined: 30 Oct 2006 Posts: 321
|
Posted: Tue Jan 02, 2007 7:45 pm Post subject: |
|
|
| Thanks for the detailed description, I've added this bug to our tracker. |
|
| Back to top |
|
 |
Adil Guest
|
Posted: Wed Jan 03, 2007 1:38 pm Post subject: |
|
|
Hi Mike,
This issue seems some what similar to what i posted under the subject titled 'onaftersaveevent not firing.' (take a look at the last few posts which deal with the deletion issue). Was this re-producible for you? Could you please confirm this bug for version 3.41 and give us an update as to when we can see a fix?
Thanks,
Adil
Numetrics Management Systems. |
|
| Back to top |
|
 |
mike_nitobi
Joined: 30 Oct 2006 Posts: 321
|
Posted: Thu Jan 04, 2007 1:09 am Post subject: |
|
|
Hi Adil,
The issue here specifically affects the last row of the grid. Is this the case for the issue you described in your thread (you didn't mention so if that's the case). Anyways, I can reproduce the issue as described in this topic for the last row, but not for an arbitrary row.
As I said, I've added this bug in our tracking system (high priority). I don't know when it will be addressed, unfortunately. |
|
| Back to top |
|
 |
Adil Guest
|
Posted: Thu Jan 04, 2007 8:42 am Post subject: |
|
|
Mike,
Well in my case, deletion of any arbitrary row leads to the 'apparent' deletion of the last row. It's always the last row that acts as a 'phantom' record and re-appears on refresh. Can you verify this? And is this the same issue as mentioned in the on-going thread?
Thanks,
Adil
Numetrics Management Systems.
[/b] |
|
| Back to top |
|
 |
mike_nitobi
Joined: 30 Oct 2006 Posts: 321
|
Posted: Thu Jan 04, 2007 10:27 pm Post subject: |
|
|
Ok, yes, that is reproducible (except for me the last row reappears only after adding a new row; refreshing does nothing). In the other thread you indicated that "the immediate next row also gets 'visibly' deleted" but made no mention of the "last row".
| Quote: | | And is this the same issue as mentioned in the on-going thread? |
I don't know because I'm not sure if the use case you're describing here is the same or not. Which description is accurate? The one you've given here or the one from the previous thread? Or both?
As I've already said, I can reproduce the problem as described by racecar789, but not the problem you've described in the other thread. |
|
| Back to top |
|
 |
Adil Guest
|
Posted: Fri Jan 05, 2007 3:39 pm Post subject: |
|
|
Mike,
Well just ignore my comments on the other thread. The ones i've posted here are an accurate description of the scenario. And also, by refresh i meant a complete page submit. Calling the grid's refresh() method doesn't bring back the phantom record but as you said, adding a record does.
For now i require an immediate solution for this. Is there some grid method that i can call after deletion of the row, which will make the phantom record re-appear? (as a temporary solution).
Thanks,
Adil
Numetrics Management Systems. |
|
| Back to top |
|
 |
Adil Guest
|
Posted: Sat Jan 06, 2007 4:59 am Post subject: |
|
|
Mike, and all others interested,
I've found a workaround to this problem thanks to James, at Nitobi. It's quite a simple fix. Just reset the rowCount property on row deletion:
myGrid.setRowCount(myGrid.getRowCount());
It works for me, although i'm not very clear about the logic of this fix.
Adil
Numetrics Management Systems. |
|
| Back to top |
|
 |
avk
Joined: 05 Mar 2007 Posts: 7 Location: Moscow, Russia
|
Posted: Wed Mar 21, 2007 7:47 am Post subject: |
|
|
myGrid - what does it mean in this context?
would you pleased to show how you define 'myGrid'? |
|
| Back to top |
|
 |
avk
Joined: 05 Mar 2007 Posts: 7 Location: Moscow, Russia
|
Posted: Wed Mar 21, 2007 7:55 am Post subject: |
|
|
I understand how to define myGrid :)
for those, who are interested:
| Code: | function resetCounter() {
nitobi.getComponent('DataboundGrid').setRowCount(nitobi.getComponent('DataboundGrid').getRowCount());
}
|
| Code: | <ntb:grid id="DataboundGrid"
..........
onafterrowdeleteevent="resetCounter();"
> |
This work fine if I delete only one record... :(
If I delete two or more records and press Save button, only first record will be physically removed from database, because only the first deleted record id is sent to SaveHandler.
Any suggestion? |
|
| Back to top |
|
 |
|