We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

EjDialog Disappears After Opening from Custom Toolbar Button

Thread ID:

Created:

Updated:

Platform:

Replies:

132208 Aug 21,2017 07:28 AM UTC Aug 22,2017 08:30 AM UTC ASP.NET MVC 1
loading
Tags: Grid
CLAUDIO RICCARDI
Asked On August 21, 2017 07:28 AM UTC

Hello,
I would like to open a Dialog form with some data from a selected row in a grid.
This is the code:
//GRID
@(Html.EJ().Grid("ContractLocationsGrid")
.Datasource(ds => ds.Json((IEnumerable)Model.ContractLocations.ToList()).UpdateURL("../NormalContractLocationUpdate").InsertURL("../NormalContractLocationInsert").RemoveURL("../NormalContractLocationDelete").Adaptor(AdaptorType.RemoteSaveAdaptor))
.EditSettings(edit =>
{
edit.AllowAdding().AllowDeleting().AllowEditing();
})
.Locale("it-IT")
...
.ClientSideEvents(eve =>
{
eve.ActionBegin("ContractLocationActionBegin");
eve.EndAdd("endContractLocationAdd");
eve.EndDelete("endContractLocationDelete");
eve.RecordClick("onContractLocationRecordClick");
eve.Load("onContractLocationsGridLoad");
eve.QueryCellInfo("onQueryCelInfo");
eve.Create("ContractLocationsGridCreate");
eve.ToolbarClick("ContractLocationsToolBarClick");
})
)
//DIALOG
@{Html.EJ().Dialog("locationForm").Title("Dati Postazione").IsResponsive(true).Containment(".popup-content-box").ContentTemplate(@

Inserire i dati della postazione

Codice

*


Livello

*


Categoria

*


Titolo

*


Codice

*

Descrizione Breve

*

Descrizione

*


@Html.EJ().Button("saveBtn").Type(ButtonType.Button).Size(ButtonSize.Medium).Height("30").Width("100").Text("Salva").ClientSideEvents(s => s.Click("maplocationformsubmit"))
).EnableModal(true).EnableResize(false).Width(291).ClientSideEvents(evt => evt.Close("onDialogClose")).IsResponsive(true).Render();}
function ContractLocationsToolBarClick(sender) {
if (sender.itemName == "WorkLocationsSync")
{
...
}
else if (sender.itemName == "WorkLocationsPutOnMap")
{
...
$("#locationForm").ejDialog("open");
}
}
The problem is that when I click on the custom toolbar button the dialog form opens but then it closes immediatly.
Where is the problem?
Thanks.
Claudio

Prasanna Kumar Viswanathan [Syncfusion]
Replied On August 22, 2017 08:30 AM UTC

Hi Claudio, 

Thanks for contacting Syncfusion support. 

According to your requirement we suspect that you need dialog editing in Grid. When we set EditMode as Dialog it will edit data using a dialog box, which displays the fields associated with the data record being edited. 
 
For more information refer the below help document.  
 
 
For your convenience we have created a sample and please download the sample from the below link. 
 
Find the code example:  
 
 
@(Html.EJ().Grid<object>("FlatGrid") 
    .Datasource(ds => ds.Json((IEnumerable<object>)ViewBag.dataSource).UpdateURL("CellEditUpdate").InsertURL("CellEditInsert").RemoveURL("CellEditDelete").Adaptor(AdaptorType.RemoteSaveAdaptor)) 
    .AllowPaging() 
    .EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.Dialog); }) 
    ------------------- 
     
     .Columns(col => 
      { 
         col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Add(); 
         col.Field("CustomerID").HeaderText("Customer ID").Add(); 
         col.Field("EmployeeID").HeaderText("Employee ID").ValidationRules(v => v.AddRule("number", true).AddRule("range", "[0,23.59]")).Add(); 
         col.Field("Freight").HeaderText("Freight").Add(); 
      }) 
   ) 
 
Screenshot:  
 
 
 

If we misunderstood your query, please get back to us. 

Regards, 
Prasanna Kumar N.S.V 



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;