简体   繁体   中英

Selecting Specific Cell from Row in JQuery

I'm using Flexigrid with its onDoubleClick function. It returns the row as a variable when the dblclick event is fired (function (g,p))

I need to get the one cell in the row (g) that has the abbr attribute "TimeBillID". I can access the cells through g.cells[index]. The cell with the abbr may not always be the first one in the row. I've tried g.cells.filter("[abbr='TimeBillID']") and g.cells.has("[abbr='TimeBillID']")

I know I can loop through each cell until i find the one that has the abbr, however I would prefer to not do that, as some of the tables that will be using this can have 20 or more cells per row.

Structure of the row:

<tr>
   <td abbr="TimeBillID"></td>
   <td></td>
..............
   <td></td>
</tr>

由于alexn答案是$(克)。儿童( 'TD')滤波器( '[简称= “TimeBillID”]')。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM