How to bind to blur event of Workbook?

Posted by: guy.g on 30 December 2018, 12:23 am EST

    • Post Options:
    • Link

    Posted 30 December 2018, 12:23 am EST

    I need to send spreadsheet data to server every time the user clicks out of the spreadsheet area.

    Is there a way to bind to blur event of workbook? I know in Wijmo FlexSheet you could use onLostFocus event to do that.

  • Posted 30 December 2018, 8:07 pm EST

    Hello,

    You can use div’s focusout event for the same i.e. it fires when one of the element in “#spredasheet” div lost focus:-

     $("#ss").focusout(function (e) {
                    debugger;
                });
    
    

    Hope it helps.

    Thanks,

    Reeva

  • Posted 30 December 2018, 10:42 pm EST

    Thanks for your reply.

    I tried adding event listener on focusout. It seems to trigger also when clicking inside the spreadjs div. If you press on one cell than press the other, on the second mouse click the event will fire.

    I was looking for a way to identify when the user clicks out of the spreadjs boundaries

  • Posted 1 January 2019, 9:53 pm EST

    Hello,

    We could observe the issue and hence we are discussing your issue with our concerned team and we will get back to you soon on the same.

    Tracking id for your issue is #268780.

    Thanks,

    Reeva

  • Posted 2 January 2019, 5:45 pm EST

    Hello,

    Please use below mentioned code for the same:-

          document.addEventListener("mouseup", function (e) {
                    var offset = $("#ss").offset();
                    var x = e.pageX - offset.left;
                    var y = e.pageY - offset.top;
                    var target = spread.hitTest(x, y);
                    if (target == null) {
                        alert("Spread Sheets lost focus");
                    }
    

    Hope it helps.

    Thanks,

    Reeva

  • Posted 7 January 2019, 2:13 am EST

    Thank you very much for the answer

  • Posted 7 January 2019, 2:45 pm EST

    Hello,

    We are glad to know that your issue has been resolved.

    Thanks,

    Reeva

Need extra support?

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

Learn More

Forum Channels