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

Posted by: tkarthik.006 on 7 August 2018, 3:33 am EST

    • Post Options:
    • Link

    Posted 7 August 2018, 3:33 am 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

  • Posted 7 August 2018, 3:40 am EST

    Hi,

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

    Thanks

    customCellType_Updated.zip

  • Posted 7 August 2018, 10: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