Get CellType

Posted by: Hoang.Nguyen on 19 September 2017, 1:12 pm EST

  • Posted 19 September 2017, 1:12 pm EST

    How do I get CellType of a cell give row and column number? Thank you very much.
  • Replied 19 September 2017, 1:12 pm EST

    How do I get CellType of a cell given row and column number? Thank you very much.
  • Replied 21 September 2017, 1:19 am EST

    Hi Hoang,
    You can get cell detail using hitTest method. This will require x and y position of the mouse. You can use this method inside any event which has mouse pointer position.

    var ht= flex.hitTest(e);
    console.log(ht.cellType,ht.row,ht.col);


    Thanks,
    Manish Kumar Gupta
  • Replied 21 September 2017, 9:37 am EST

    I am trying to check for cellType inside (press) event. This event does not provide mouseArgs but it as pointerArgs. How do I retrieve mouse x, y from this args sir?
  • Replied 22 September 2017, 10:31 am EST

    Hi Hoang,
    You can pass "e" as the argument. Please refer to the code for the same:


    this.flex.hostElement.addEventListener("touchstart",(e)=>{
    var ht: wjGrid.HitTestInfo;
    ht = this.flex.hitTest(e);
    if (ht && ht.cellType == wjGrid.CellType.Cell) {
    alert("Cell");
    }
    }
    });


    Thanks,
    Manish Kumar Gupta
Need extra support?

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

Learn More

Forum Channels