- Home
- Forum
- ASP.NET MVC
- Custom close buttons
Custom close buttons
$("#dialog").ejDialog({
closeOnEscape: true,
contentType: "iframe",
contentUrl: url,
close: function (args) { window.location.reload(); }
});
$("#dialog").ejDialog("open");
Thanks,
Catalina
Thanks for using Syncfusion products,
Your requirement is achieved using the “close” method of the dialog control. Refer to the Help Document and code example as below.
Help Document: http://help.syncfusion.com/js/api/ejdialog#methods:close
|
function onDialogClose(args) { $("#lognForm").ejDialog("close"); } |
We have created a simple dialog sample in jsplayground link. Please refer to the below link.
http://jsplayground.syncfusion.com/jxauvqrp
We have created a sample using dialog control in ASP.NET MVC. You can get this sample in below location,
http://www.syncfusion.com/downloads/support/forum/123327/ze/SyncfusionMvcApplication1-821016937
Please let us know if you have any queries,
Regards,
Balaji Marimuthu
Catalina
We need to attach an event to the button for close the dialog and solved the reported issue using Syncfusion Dialog. We have created a sample using the partial view and render the edit controls, save & cancel button. Refer to the sample and code example as below.
Sample: PartialView-Dialog
|
[PartialView] @model SyncfusionMvcApplication51.OrdersView
<div> <div> @Html.Label("OrderID") </div> <div> @Html.TextBox("OrderID", Model.OrderID.ToString(), new { @readonly = "readonly" }) </div><br /> . . . .
<div class="col-md-3"> @(Html.EJ().Button("save").Text("Save").ClientSideEvents(eve => eve.Click("onClose"))) @*bind an event to button*@ </div> <div class="col-md-3"> @(Html.EJ().Button("cancel").Text("Cancel").ClientSideEvents(eve => eve.Click("onClose"))) @*bind an event to button*@ </div> <br /> <br /> </div> function onClose(args) { $("#partialgrid").ejDialog("close"); //close dialog |
We have rendered the partialview in Grid RecordDoubleClick event and opened the dialog.
|
function recordDblClick(args) { var records = this.getSelectedRecords()[0]; //getSelected records value $.ajax({ url: "/Grid/GetData", type: "POST", contentType: "application/json", data: JSON.stringify({ value: records }), success: function (data) { $("#partialgrid").html(data); ej.widget.init($("#partialgrid")); //initialize the ejwidgets
$("#partialgrid").ejDialog("open");
}, error: function (xhr) { alert('error');
} });
|
Kindly check the attached sample and get back to us if you need any further assistance.
Regards,
Balaji Marimuthu
Attachment: EJToolbar_error_95f6e242.zip
We are sorry for the inconvenience.
Query: 1 ejDialog Error.
We checked the attached screenshots and could you please ensure that you have rendered the dialog initially before calling the ejDialog open method?
Because in the last update, we have provided code for dialog open and hide, and have not mentioned the dialog rendering code. But in the sample, we have rendered the dialog initially and opened the dialog in AJAX success event.
Refer to the modified code example as below.
|
function recordDblClick(args) { var records = this.getSelectedRecords()[0]; //getSelected records value $.ajax({ url: "/Grid/GetData", type: "POST", contentType: "application/json", data: JSON.stringify({ value: records }), success: function (data) { $("#partialgrid").html(data); ej.widget.init($("#partialgrid")); //initialize the ejwidgets
$("#partialgrid").ejDialog( { enableResize: false, width: 300, width: 300, close: "onDialogClose" });
$("#partialgrid").ejDialog("open");
}, error: function (xhr) { alert('error');
} });
|
Query:2 ejToolbar error
We were unable to reproduce the issue from our side. So, kindly share the following information to find the cause of issue and provide a better solution at the earliest.
Sample: Sample-123346
Regards,
Balaji Marimuthu
Thanks for the update.
We have checked with the mentioned versions of Syncfusion and jQuery library. But we were unable to reproduce the reported issue. So we will wait until we hear back from you.
Regards,
Balaji Marimuthu
We are happy to hear that your issue is resolved. Please get back to us if you need any further assistance.
Regards,
Balaji Marimuthu
- 10 Replies
- 2 Participants
-
CV Catalina Vatuiu
- Mar 8, 2016 03:19 PM UTC
- Mar 18, 2016 07:31 AM UTC