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

How do i get the value of the cell on singleClick

Thread ID:

Created:

Updated:

Platform:

Replies:

151398 Feb 10,2020 02:25 PM UTC Feb 12,2020 03:44 PM UTC Vue 3
loading
Tags: Data Grid
Michael Kornatzki
Asked On February 10, 2020 02:25 PM UTC

Hi,

how do i get the value in a single click checkbox to invert it? 

Kind regards,
michael

Dhivya Rajendran [Syncfusion]
Replied On February 11, 2020 02:06 PM UTC

Hi Michael, 

Greetings from Syncfusion Support. 

Query: how do i get the value in a single click checkbox to invert it?  
 
We suspect that you need to get the data , when you click on a row. You can achieve your requirement by using the rowSelected event of Grid. In the rowSelected event you can get the details such as rowIndex, rowElement and row data. Please refer to the sample code below and sample link for more information. 


<ejs-grid  
                 :rowSelected="rowSelected"> 
                 . 
              </ejs-grid>    

rowSelected: function(args){ 
      console.log(args.data); 
      //You can get the Row details in rowSelected event 
    } 
  
  
If we have misunderstood your query, please share more or below details that will be helpful for us to analyze further at our end. 

  1. Please share your requirement more briefly.
  2. Please share your Grid code example

Regards, 
R.Dhivya 
  
  


Michael Kornatzki
Replied On February 11, 2020 02:13 PM UTC

Hi,

in the eample 

      load: function() {
        this.$refs.grid.ej2Instances.element.addEventListener('mousedown', function(e) {
          var instance = this.ej2_instances[0];
          if (e.target.classList.contains("e-rowcell")) {
            let index = parseInt(e.target.getAttribute("Index"));
            let colindex = parseInt(e.target.getAttribute("aria-colindex"));
            let field = instance.getColumns()[colindex].field;
            instance.editModule.editCell(index, field);
          };
        });

i have a editorModule.
I was hoping that i can get the value somehow and can update the cell.

I want to click on a checkboxrenderer and the value should change without opening the editor.

Kind regards,
Michael 




Dhivya Rajendran [Syncfusion]
Replied On February 12, 2020 03:44 PM UTC

Hi Michael, 

Thanks for sharing the details. 

We have analyzed your requirement and you can achieve this by using the below way. In the below sample, we have used the same way like single click editing in batch mode but in that mousedown event of Grid we have checked the columns is checkbox column(Verified) or not and if its checkbox column then we have used updateCell method instead of editCell to update the checkbox value in Grid. 

Please refer the below code example and sample for more information. 

load: function(args) { 
      this.$refs.grid.ej2Instances.element.addEventListener( 
        "mousedown", 
        function(e) { 
          var instance = this.ej2_instances[0]; 
          if (e.target.classList.contains("e-rowcell")) { 
            let index = parseInt(e.target.getAttribute("Index")); 
            let colindex = parseInt(e.target.getAttribute("aria-colindex")); 
            let field = instance.getColumns()[colindex].field; 
            if (field === "Verified") { 
              instance.editModule.updateCell(index, field, e.target.querySelector(".e-check") ? false : true 
              ); 
            } else { 
              instance.editModule.editCell(index, field); 
           
         
       
      ); 
   



Please get back to us if your require further assistance on this. 

Regards, 
R.Dhivya 


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

Live Chat Icon For mobile
Live Chat Icon