Hi,
I have a very big problem to solve. I found out this strange behavior, and I understood what it is, but I don't know in which way to solve it.
I have a grid definde by controller side, on which I've enabled the RowEditTemplate GridEditMode.By view side I catch the event related to the dialog close:
$("#grid_1").live('iggridupdatingroweditdialogclosed', function (event, ui) { if (event.buttons == 0) { $("#grid_1").igGrid("saveChanges"); window.setTimeout("refreshPartialView()", 1000); } });In this way I am able to understand if the Ok button has been clicked (event.buttons==0), therefore call the saveChanges UpdateUrl. After 1 second, time I set just to be sure that record has been placed in the db, I refresh just only the grid, calling the refreshPartialView js method:
function refreshPartialView() { $('#div_1').load( "/ControllerName/RefreshAction", { id: $('#id_text').val() }, function (response, status, xhr) { if (status == "error") { alert(status); } }); }
This method correctly calls the controller action that correctly returns the igGrid partial view. "Refreshed" grid is loaded in the div:
Until here NO PROBLEMS: grid is correctly loaded and showed.When does the problem start? NOW: if I select a row and try to edit it, dialog correctly appears, but iggridupdatingroweditdialogclosedevent is not caught, and sosaveChangesis not called anymore.
I noted that all igGrid-catchEvents-methods still works after the refresh: for example I have an iggridselectionrowselectionchanged event that is still caught by the javascript, after the partial view load too. Just row edit dialog events are not caught...
Do yu have any ideas? Is it possible that I have to destroy the dialog once I refresh the igGrid? How?
Thanks in advance
Flavio
For example, also a function like the following one:
$("#grid_1").live('iggridupdatingroweditdialogcontentsrendered', function (event, ui) { alert(123);});
Prints 1 only the first time dialog is opened. But if I close it, I select antoher row and I press F2, the dialog appears without printing 123, i.e. dialog is considered as already rendered...