Get row index for datatable

View: New views
2 Messages — Rating Filter:   Alert me  

Get row index for datatable

by Satish-14 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

How to get the rowindex when clicked on some row element?. Actual
problem is i have four columns and tow rows on the column on each  row
i have remove as my data i.e when clicked on remove i want to delete
that row. so i want to get the rowindex when clicked on that remove link.


Re: Get row index for datatable

by Satyam-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The DataTable has utility functions to find out what was clicked, they
work in all click events, row, cell, link, button.

myDataTable.on('whateverClickEvent', function (oArgs) {
    var target = oArgs.target;
    var record = this.getRecord(target);
    var column = this.getColumn(target); // not valid for rowClickEvent
    var value = record.getData(column.key);  // same as before.

});

You wouldn't be able to identify the column on a row click event since
the event is fired for all the row.  From then on, you can get all sorts
of info.

Satyam


Satish wrote:

> Hi,
>
> How to get the rowindex when clicked on some row element?. Actual
> problem is i have four columns and tow rows on the column on each  row
> i have remove as my data i.e when clicked on remove i want to delete
> that row. so i want to get the rowindex when clicked on that remove link.
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com 
> Version: 8.0.138 / Virus Database: 270.4.5/1535 - Release Date: 04/07/2008 17:03
>
>
>
>  
LightInTheBox - Buy quality products at wholesale price