Hi there,
I'm using latest release and binding my grid from java script. I have a two same issue on all my grids.
1. When I'm adding new row and before clicking update button if I click outside new row (any row in the grid) it close the new adding row and I lost all my entered information.
I found same thing on your API:
http://es.infragistics.com/products/jquery/sample/grid/row-adding-api
My requirement is that I don't want to close the expanded new row if I click outside on the grid.
Please advise any help. I tried some things like below in editRowEnding event:
if (ui.rowAdding == true && ui.update == false) { evt.preventDefault(); }
2. When I added new row successfully, It always show new added row at the bottom current grid page. Is there anyway if I want to show that at the top (first row of grid)
Regards,
Jasdeep
Hi,
I managed to fix my first issue with this:
function editRowEnding(evt, ui) { if (ui.rowAdding == true && ui.update == false) { if (evt.currentTarget.title == "Stop editing and do not update") return false; else ui.keepEditing = true; } else {
// adding row code
}
Still looking advise for point 2 from above post.
Hello Jaseep,
Great job about fixing yourself the first issue!
Now on the second issue...
You can detach the last row from the html DOM and then reattach it again on the first position of the grid. You should keep in mind the zebra styles of the grid.
Also the records in the data source will be appended to the data, so you should also delete and then insert the new record at the right position in the data source.
I'm attaching a sample which demonstrates this approach.
Hope this helps,Martin PavlovInfragistics, Inc.
Hi Martin,
Thanks for your reply.
I'm one step further with you code help. Now it shows new added now at top of my Grid. But if I tried to edit that row just after adding it, I always got rowID of previous row (which was at top before adding new one)
function rowSelectionChanged(evt, ui) { var dataview = $("#tbGrid").data("igGrid").dataSource.dataView(); var cellValue = dataview[ui.row.index]["Id"];}
Any advise please? I don't want to rebind the grid here.
Hello,
In rowSelectionChanged event you can get the row index and Id using the following syntax:
ui.row.index
ui.row.id
Let me know if this helps.
I'm just checking if you managed to resolve your issue.
Hello Simon,
If you need any additional assistance with this case feel free to contact me.
I will keep this case open for another three days while I am waiting for your response. If at that time you haven't responded, I will close it.
Please note that closed cases may be reopened within thirty days of closure.
Thank you for choosing Infragistics components.