hellow,
I have an issue with closing a WebDialogWindow using a JS code.
so for showing the dialog, I'm using the following vb.net code:
WebDialogWindow9.WindowState = Infragistics.Web.UI.LayoutControls.DialogWindowState.Normal
the above code works fine, and inside that dialog there is a button called (Cancel), this button suppose to close/hide the WebDialogWindow9, so I'm using this JS code:
function closeDialogs() { var win = window.parent; var dialog = win.$find('WebDialogWindow9');
if (dialog) { dialog.hide(); } }
========
<igtxt:WebImageButton ID="WebImageButton2" runat="server" Text="Cancel" Width="135px"> <ClientSideEvents Click="closeDialogs" /> <Appearance> <Image Url="./Res/Actions-button-cancel-icon1.png" /> </Appearance> </igtxt:WebImageButton>
but it does nothing when I click on the button? could you please assist me with this.
Hello,
Another alternative to the show/hide methods is setting the windowState property to either Normal or Hidden, so what you could try is changing the code to:
dialog. .set_windowState($IG.DialogWindowState.Hidden);
The use of these properties has been demonstrated in the WebDialogFrame.aspx file in the following sample:
https://www.infragistics.com/samples/aspnet/dialog-window/confirmation-dialog
Please let me know if you need any further assistance.
Regards, Ivan Kitanov
still having the same issue, no result when I click.
Thanks again for you support, the thing that the webdialog is linked to another form, as the following:
<ig:WebDialogWindow ID="WebDialogWindow9" runat="server" Height="400px" InitialLocation="Centered" Moveable="False" Width="950px" WindowState="Hidden"> <ContentPane ContentUrl="Test.aspx" ScrollBars="Hidden"> </ContentPane> <Header CaptionText="Test"> </Header> </ig:WebDialogWindow>
And that form (Test.aspx) has couple text inputs and 2 buttons, one for saving data and the other one for canceling the changes, which suppose to close the dialog window.
can this work? as I tried to use JS find the webdialog inside the parent page to close it:
var win = window.parent; var dialog = win.$find('WebDialogWindow9');
this code is inside the "Test.aspx"
another thing, the webdialigwindow9 is inside a WebTab tags in the parent page. If this matters.
thanks again
I believe that your scenario is similar to the one discussed in the following forum post, where Viktor has provided a way to find a control that is in different aspx page.
If this doesn’t resolve the issue, it would be best if you could provide a small sample that demonstrates the issue. Please remove any external dependencies and code that is not directly related to the issue, zip your application and attach it 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.
Thank you for your cooperation.
Looking forward to hearing from you.
here is a sample project
https://seupload.com/vkb/TestWebDialogWindow.rar
Thank you providing a sample. After some investigation, I’ve come with a very simple solution. Instead of trying to find the WebDialogWindow from the page that is provided as a ContentURL, what it could be done instead is creating a function to close the WebDialogWindow in the parent page and then accessing it from the child page.
The changes that need to be done are as follows:
1) Add the following function to the MainPage.aspx:
function CloseDialogJS() { var dialog = $find('<%= WebDialogWindow1.ClientID %>'); dialog.hide(); }
2) Change the following function in WebForm1.aspx:
function closeDialogs() { window.parent.CloseDialogJS(); }
Please test the following approach and let me know if you have any questions.
Thanks Ivan, you solved my issue, i really appreciate your support.
Hi,
I’m glad that you found my suggestion helpful and managed to resolve your issue.
Thank you for choosing Infragistics!
Regards,Ivan Kitanov