Expose onclick event when clicked on a specific cell position in custom cell

Posted by: tkarthik.006 on 6 August 2018, 6:33 pm EST

  • Posted 6 August 2018, 6:33 pm EST

    Hi,

    I want to expose an onclick event when clicked on a specific position of a custom cell.

    I've provided an example to show the implementation. I need an event to be exposed on click of the icon present in the left side of the cell.

    Thanks,

    customCellType (1).zip
  • Replied 6 August 2018, 6:40 pm EST

    Hi,
    I've updated the example, please ignore the before attachment and consider this example.


    Thanks


    customCellType_Updated.zip
  • Marked as Answer

    Replied 7 August 2018, 1:04 am EST

    Hello,

    With your custom celltype code you can use the code as follows to identify when the custom cell icon is clicked:


    $("#ss").click(function (e) {
    //Acquire cell index from mouse-clicked point of regular cells which are neither fixed rows/columns nor row/column headers.
    var offset = $("#ss").offset();
    var x = e.pageX - offset.left;
    var y = e.pageY - offset.top;
    var target = sheet.hitTest(x, y);
    target.cellTypeHitInfo.isReservedLocation
    if (target.cellTypeHitInfo.isReservedLocation==true) {
    alert("icon clicked");
    }
    });


    Thanks,
    Deepak Sharma
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels