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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

EjGrid checkbox column events

Thread ID:

Created:

Updated:

Platform:

Replies:

126309 Oct 6,2016 02:47 PM UTC Mar 27,2019 07:03 AM UTC JavaScript 5
loading
Tags: ejGrid
Ignacio
Asked On October 6, 2016 02:47 PM UTC

Hi, how can i add a change event for a checkbox column i have on a grid?
I could use events in command cols but i'm not sure how to do it for a column with a control (a checkbox in this case).

Thanks!

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On October 7, 2016 08:32 AM UTC

Hi Ignacio, 

Using template property of the Grid columns, you can render the checkbox in the Grid columns and templateRefresh events will be used to bind controls/events to the template elements. Refer to the following code example and Help Documents. 

    <script type="text/x-jsrender" id="columnTemplate"> 
        <input type="checkbox"> 
    </script> 
    <div id="Grid"></div> 
    <script type="text/javascript"> 
        $(function () { 
            $("#Grid").ejGrid({ 
                // the datasource "window.gridData" is referred from jsondata.min.js 
                dataSource: window.gridData, 
                allowPaging: true, 
                columns: [ 
                                  { headerText: "checklist", template: "#columnTemplate" }, 
                     . . .  
                      . . 
                ], 
                templateRefresh: function (args) { 
                    $(args.cell).find("input").ejCheckBox({ 
                        change: function (args) { 
                            console.log("changed"); 
                        } 
                    }) 
                } 
            }); 
        }); 
    </script> 
  
Note: We have rendered CheckBox control with their change event. Likewise, you can bind events for generic checkbox. 


We have prepared a sample that can be referred from the following jsPlayground. 


Regards, 
Seeni Sakthi Kumar S. 


Ignacio
Replied On October 7, 2016 08:35 PM UTC

Ok, thanks!

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On October 10, 2016 04:10 AM UTC

Hi Ignacio, 

Thanks for the update. Please get back to us if you need further assistance on this. 

Regards, 
Seeni Sakthi Kumar S. 


Guadalupe
Replied On March 26, 2019 08:53 PM UTC

Hi Ignacio, 

Thanks for the update. Please get back to us if you need further assistance on this. 

Regards, 
Seeni Sakthi Kumar S. 


Hello 

This is possible with asp.net?

I need the example please.


Cordially, Guadalupe Baigorria

Vignesh Natarajan [Syncfusion]
Replied On March 27, 2019 07:03 AM UTC

Hi Guadalupe, 
 
Thanks for the update. 
 
Query: This is possible with asp.net? 
 
Yes. it is possible. We have prepared a sample in ASP.NET to trigger a event when checkbox inside the Grid is changed. We have achieved that requirement using TemplateRefresh event of ejGrid. Please refer the below code example, 
 
  <script type="text/x-jsrender" id="columnTemplate"> 
        <input type="checkbox"> 
    </script> 
 
    <ej:Grid ID="EmployeesGrid" runat="server" AllowPaging="True"> 
        <PageSettings PageSize="4"></PageSettings> 
        <ClientSideEvents TemplateRefresh="refresh" /> 
        <Columns> 
            <ej:Column HeaderText="checkbox" Template="#columnTemplate" TextAlign="Center" Width="110" /> 
………………………. 
        </Columns> 
    </ej:Grid> 
 
    <script> 
        function refresh(args) { 
 
            $(args.cell).find("input").ejCheckBox({ 
                change: function (args) { 
                    console.log("changed"); 
                } 
            }) 
        } 
 
 
    </script> 
 
Kindly download the sample from below link. 
 
 
Refer our API documentation for your reference 
 
 
Please get back to us if you have further queries.  
 
Regards, 
Vignesh Natarajan. 
 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

;