DialogTemplate button click open Dialog grid

Hi
How to get details (ShipCountry,CountryCode)  from  (template button click open dialog grid ) dialog grid


 <script type="text/javascript">

        $("#btncountry").ejButton({

            text: "...",

            click: function (args) {

               alerd('yes');

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

            }

        });

            function openinvoice(args) {

                $("#ShipGrid").ejGrid({ allowPaging: true });

            }

            function rowSelected(args) {

                var textvalue = true;

                $("#ShipCountry").val(args.data.ShipCountry);

                $("#CountryCode").val(args.data.CountryCode);

                var gridObj = $("#ShipGrid").data("ejGrid");

                gridObj.clearSelection(args.rowIndex); 

                $("#Dialog").ejDialog("close");

       

            }

</script>


Attachment: WebApplication1_afb73a38.rar

3 Replies

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team October 25, 2017 05:00 PM UTC

Hi Prasanna, 

Please review the response. 

Hi Pratheep, 

Thanks for contacting Syncfusion Support. 

We have checked your query and when we use template editing you can change the elements that are defined in the Template to appropriate JS controls  in actionComplete event of the Grid. Your reported problem occurs when you does not render ejButton inside the actionComplete event.So we suggested you to render ejButton on ActionComplete event of the Grid. We have modified the sample which can be downloaded from the below location. 


Please refer to the code example:- 

     <ej:Grid ID="OrdersGrid" runat="server" AllowPaging="True" > 
          <ClientSideEvents ActionComplete="complete" EndAdd="endAdd" EndDelete="endDelete" EndEdit="endEdit" /> 
                    <Columns> 
                          .  .  . 
                    </Columns> 
          <ToolbarSettings ShowToolbar="True" ToolbarItems="add,edit,delete,update,cancel"></ToolbarSettings> 
     </ej:Grid> 
 
     function complete(args) { 
         $("#btncountry").ejButton({ 
                text: "template button", 
                click: function (args) { 
                    alert('yes'); 
                    $("#Dialog").ejDialog("open"); 
                } 
            }); 
            function rowSelected(args) { 
                var textvalue = true; 
                $("#ShipCountry").val(args.data.ShipCountry); 
                $("#CountryCode").val(args.data.CountryCode); 
                var gridObj = $("#ShipGrid").data("ejGrid"); 
                 gridObj.clearSelection(args.rowIndex);                 
                $("#Dialog").ejDialog("close"); 
          } 
       } 
    </script> 
 
           

Refer to the documentation and Online Demo Link:- 



Please get back to us if you need any further assistance. 

Regards, 

Farveen sulthana T 



PR Pratheep October 26, 2017 01:02 AM UTC

Hi Farveen

Thank you for support

Thanks

Pratheep



FS Farveen Sulthana Thameeztheen Basha Syncfusion Team October 26, 2017 03:56 AM UTC

Hi Pratheep, 
  
Thanks for your reply. Please get back to us if you need any further assistance. 
  
Regards, 
  
Farveen sulthana T 


Loader.
Up arrow icon