I have these 2 functions that open a WebDialogWindow from a WebDataGrid.
Client sidefunction WebDataGrid1_DblClickHandler(sender, e) { var grid = $find('<%= WebDataGrid1%>'); var gridBehaviors = grid.get_behaviors(); var row = gridBehaviors.get_selection().get_selectedRows().getItem(0); var rowId = row.get_dataKey() var dialog = $find('<%= WDWIns.ClientID %>'); dialog.get_contentPane().set_contentUrl('management.aspx?key=' + rowId); dialog.set_windowState($IG.DialogWindowState.Normal);}
Server sidePrivate Sub WebDataGrid1_ItemCommand(sender As Object, e As HandleCommandEventArgs) Handles WebDataGrid1.ItemCommand Dim commandArgument As Object = e.CommandArgument Dim key As String = commandArgument.ToString Dim url As String = "management.aspx?key=" + key WDWIns.ContentPane.ContentUrl = url WDWIns.WindowState = Infragistics.Web.UI.LayoutControls.DialogWindowState.NormalEnd Sub
When the user is done making changes to the data on the WebDialogWindow I close the window using this function.
function closeDialogs() { var win = window.parent; var dialog = win.$find('WDWIns'); if (dialog) { dialog.hide(); }}
Becasuse the user has made changes to the data, I need to refresh the WebDataGrid. How can I do that?
Thanks, Pat
Hello Pat,
Thank you for posting in our community.
To refresh WebDataGrid you can call the doPostBack function:
function closeDialogs() { var win = window.parent; var dialog = win.$find('WDWIns'); if (dialog) { dialog.hide(); __doPostBack(""); } }
I have created a small sample with the given information trying to reproduce the described behavior, which you will find attached. If this is not an accurate demonstration of what you are trying to achieve please feel free to modify it and send it back to me. Alternatively, if the behavior cannot be replicated please feel free to provide your own sample. Remove any external dependencies and code that is not directly related to the issue, zip your application and attach in in this case.
Having a working sample on my side, which I can debug, is going to be very helpful in finding the root cause of this behavior.
0677.Sample.zip
I'm attaching an example based off your sample. I changed the language to VB. I added a postback to the default page load so I can see the data in the WebDataGrid refresh. On the WebDialogWindow I added a button. In my application the button does saving of the data to the database, etc. When I click on the "x" in the WebDialogWindow the window closes and the default page reloads and refreshes the WebDataGrid data. When I click on the "ok" button the WebDialogWindow closes but the default page does not reload therefore the WebDataGrid data does not refresh.
GridRefreshUpload.zip
Hi Pat,
Thank you for your sample. By calling the doPostBack function from the parent of the iframe, the WebDataGrid should refresh:
function closeDialogs() { var win = window.parent; var dialog = win.$find('wdw'); if (dialog) { dialog.hide(); win.__doPostBack(""); } }
Please let me know if you need any further assistance with this matter.
Martin,
That worked. Thanks!
Pat
I am glad that you find my suggestion helpful.
Thank you for using Infragistics components.