Wijmo UI for the Web
Fetch Selected Cell

The wijgrid widget allows users to fetch the line number and column index of a cell by using the args parameter of cellClicked event.

For example, the script below sets the selectionMode to singleCell and uses the index property of a grid element to fetch its data. When a user clicks a cell, a JavaScript alert displaying Row and Column index pops up on screen.

Script
Copy Code
<script type="text/javascript">
    $(document).ready(function () {
        $('#wijgrid').wijgrid({
           data: [
        ['Ipsum LLC', 63.57, 209, .11, '04-05-2014'],
        ['Lorem Inc', 74.85, 73, .19, '22-01-2014'],
        ['Dolor International', 29.86, 45, .20, '07-08-2014'],
        ['Blandit Enterprises', 81.68, 28, .25, '18-06-2014'],
        ['Vivamus Services', 76.30, 67, .12, '30-04-2014']
            ],
            columns: [
        { headerText: "Product Name", dataType: 'string' },
        { headerText: "Unit Price", dataType: 'currency' },
        { headerText: "Quantity", dataType: 'number', dataFormatString: 'n0' },
        { headerText: "Discount", dataType: 'number', dataFormatString: 'p0' },
        { headerText: "Order Date", dataType: 'datetime', dataFormatString: 'dd-MM-yyyy' }
            ],
            selectionMode: 'singleCell',
            cellClicked : function (e, args) {
            alert('Line:' + args.cell.rowIndex() + 'Column:' + args.cell.cellIndex());
            }
        });
    });
</script>