Suite 7.3.0 grid eventHandlers returns empty row and col object


#1

this example:
https://snippet.dhtmlx.com/zcv5drxc?_ga=2.128706444.1863250148.1643139181-1131163540.1608213195

which has implemented eventHandles for custom html cells returns empty row | col object.
In version 7.2.5 it was working better - returning the col object but undefined for the row object.

PLS!!! FIX IT ASAP!!!


#2

Could you please, clarify the exact steps to reproduce your mentioned issue.


#3

Here is the source code that would reproduce the error:

this.grid = new dhx.Grid(this.gridContainer.nativeElement, {
  columns: [
    { id: "index", type: 'number', width: 50, minWidth: 50, maxWidth: 50, header: [{ text: "No:" }, { content: "inputFilter" }], autoWidth: false, editable: false, tooltip: false },
    { 
      id: "comments", 
      width: 50, 
      minWidth: 50, 
      maxWidth: 50, 
      header: [{ text: "" }], 
      autoWidth: false, 
      resizable: false, 
      editable: false, 
      sortable: false, 
      draggable: false, 
      align:'center', 
      type: "string", 
      htmlEnable: true, 
      template: (text, row, col) => {
        return `<div class='icon-container'>
          <i class="material-icons comment">chat_bubble_outline</i>
        </div>`;
      } 
    }
  ],
  eventHandlers: {
    onclick: {
      comment: (event, data) => {
        console.log(data);
      }
    }
  }
});

In the eventHandlers -> onclick the data object contains undefined col and row objects. In version 7.2.5 the row object is undefined but the col object works as expected.


#4

Your provided code seems to work correctly:
https://snippet.dhtmlx.com/6edei9f9


#5

Download the API via the website. Click download suite. It will be sent to ur email. Then download it from there and import it into a project.

The link u posted works but PROBABLY because the API is fixed. The one which is sent over email doesnt work


#6

In the linked snippet the dhx.Suite 7.3 is used, just like you’ve mentioned in the topic and in your original snippet.
Please, check that you are using the 7.3 build. If the problem still occurs for you please, provide a complete demo, where the problem could be reconstructed locally.


#7

Here is a snippet where it can be tested:
https://snippet.dhtmlx.com/tg1btdt1

Last column is with enabled html and there is a click event defined.

If you are using version: 7.2.5 the data object contains the col and row objects.
If you are using version 7.3.0 the data object in some snippets contains only the col object or only the row object. In many cases neither the col nor the row object are returned.


#8

Just for information, I confirm that i have encountered the same issue on the 7.3.0 downloaded.
I solve it temporary by using grid.events.on(“cellClick”, function(row,column,e){
but i’m interested by the resolution of this issue.
Best regards


#9

Thank you for the snippet and the clarification. The problem is confirmed. We’ll try to fix it in one of the future updates.


#10

Hello Nikolai.

We have fixed your reported problem in the latest dhx.Suite update (v 7.3.2.)
You can test it in your original snippet:
https://snippet.dhtmlx.com/tg1btdt1
Please, try to download the latest available build to get that fix.
Thank you for your report.