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. Image for the cookie policy date
close icon

Prevent open Two ejDialog

I Have two ejGrid in both Add and Edit operation i do trough ejDialog,
In Toolbar i have My Icon to Add new Record, that is ok in both,
For update Row i use ClientSideEvent RowSelected.
When I select row in first ejGrid  to edit with this javascript

function RTypeDialogUp(args) {

$("#AdminContent_TypeUp").ejDialog("open");

$("#AdminContent_TypeUp_lblRTypeId").html(args.data["RtId"]);

var Rtta = args.data["RoomType"];

$("#AdminContent_TypeUp_txtRTName").val($.trim(Rtta))

$("#AdminContent_TypeUp_NumMaxAdults").ejNumericTextbox({ value: (args.data["MaxAdults"]) })

$("#AdminContent_TypeUp_NumMaxChild").ejNumericTextbox({ value: (args.data["MaxChild"]) })

var colorObj = $("#AdminContent_TypeUp_ColoRicker2").ejColorPicker().data("ejColorPicker");

colorObj.setValue(args.data["TypeColor"]);

}

 is ok on close with this code

function closeTypeUp() {

var RTY = $("#AdminContent_TypeUp").data("ejDialog");

RTY.close();

$("#AdminContent_GridRoomType").ejGrid({ selectedRowIndex: -1 })

}

 yet everything is ok
And Next when I select row i second grid in the same time its opens both ejDialog - first is dialog from secon grid next is selecte last selected row in first grid then dialog from first gris is open.
When I do it revers, this does not happen

How to prevent open two dialogs i one time.
one screen:

3 Replies

SS Selvamani Sankarappan Syncfusion Team August 15, 2017 05:34 AM UTC

Hi Tomasz, 
 
Thanks for contacting Syncfusion support. 
 
We have checked your screen shot. But, we were unable to reproduce the reported issue at our end. We suspect that the issue may be caused due to have using same Dialog id for dialog open method. Please refer to the following code example: 
 
[aspx] 
<div id="content"> 
        <ej:Grid ID="OrdersGrid1" runat="server" AllowPaging="false" AllowSelection="true" Selectiontype="Single"> 
            <ClientSideEvents RowSelected="rowSelected1" /> 
            <SelectionSettings SelectionMode="row" /> 
            <Columns> 
                <ej:Column Field="StId" /> 
                <ej:Column Field="RoomStatus" /> 
                <ej:Column Field="StatusColor" /> 
            </Columns> 
        </ej:Grid> 
 
        <ej:Dialog ID="basicDialog1" runat="server" Title="Dialog 1" ShowOnInit="false" Target="#content"> 
            <DialogContent> 
                <asp:Label ID="label" runat="server"></asp:Label> 
                <asp:TextBox ID="textbox" runat="server"></asp:TextBox> 
                <ej:ColorPicker ID="colorpicker" runat="server"></ej:ColorPicker> 
            </DialogContent> 
        </ej:Dialog> 
    </div> 
 
 
<div id="content1" style="margin-top:60px;"> 
        <label>Grid 2</label> 
        <ej:Grid ID="OrdersGrid2" runat="server" AllowPaging="false" AllowSelection="true" Selectiontype="Single"> 
            <ClientSideEvents RowSelected="rowSelected2" /> 
            <SelectionSettings SelectionMode="row" /> 
            <Columns> 
                <ej:Column Field="StId" /> 
                <ej:Column Field="RoomStatus" /> 
                <ej:Column Field="StatusColor" /> 
            </Columns> 
        </ej:Grid> 
 
        <ej:Dialog ID="basicDialog2" runat="server" Title="Dialog 2" ShowOnInit="false" Target="#content1"> 
            <DialogContent> 
                <asp:Label ID="label1" runat="server"></asp:Label> 
                <asp:TextBox ID="textbox1" runat="server"></asp:TextBox> 
                <ej:ColorPicker ID="colorpicker1" runat="server"></ej:ColorPicker> 
            </DialogContent> 
        </ej:Dialog> 
    </div> 
 
[script] 
function rowSelected1(args) { 
            var dialogObj = $("#<%=basicDialog1.ClientID%>").data("ejDialog"); 
            dialogObj.open(); 
            $("#MainContent_basicDialog1_label").text(args.data["StId"]); 
            $("#MainContent_basicDialog1_textbox").val(args.data["RoomStatus"]); 
            var colorObj = $("#<%=colorpicker.ClientID%>").data("ejColorPicker"); 
            colorObj.setValue(args.data["StatusColor"]); 
        } 
 
function rowSelected2(args) { 
            var dialogObj = $("#<%=basicDialog2.ClientID%>").data("ejDialog"); 
            dialogObj.open(); 
            $("#MainContent_basicDialog2_label1").text(args.data["StId"]); 
            $("#MainContent_basicDialog2_textbox1").val(args.data["RoomStatus"]); 
            var colorObj = $("#<%=colorpicker1.ClientID%>").data("ejColorPicker"); 
            colorObj.setValue(args.data["StatusColor"]); 
        } 
 
We have prepared the sample based on your requirement. Please refer to the following sample: 
 
 
If the above does not meet your requirement, kindly share modified sample based on your application to check and provide an appropriate solution at the earliest. 
 
Regards, 
 
Selvamani S. 
 



TO Tomasz August 17, 2017 12:13 PM UTC

Hi Selvamani

Thank You for You help I find my fault, now its ok.



SS Selvamani Sankarappan Syncfusion Team August 18, 2017 10:49 AM UTC

Hi Tomasz, 

Thanks for the update. 

Let us know if you need any further assistance. 

Regards, 

Selvamani S. 


Loader.
Live Chat Icon For mobile
Up arrow icon