Frage

I have a column that is a FK and so cannot have the ID value. Instead, I show a String value. All well and good,except when I select a row and take an action, I need that value.

As you may know, flexigrid adds "abbr=" for sortable columns, but leaves them off for non-sorting columns.

I'm sure there is some jquery expression that will work. I thought something like:

$('td:nth-child(4)', this).html()

Here is the HTML structure I am trying to navigate: JSP source

Nothing I've tried works - just get syntax errors. Can anyone help?

War es hilfreich?

Lösung

I finally managed to get this to work. Here is the answer:

$('td:nth-child(4) >div', this).html();

This says: get the 4th td in the selection, then go to the div child; finally, get the html text for the child.

Hope this helps someone else.

Andere Tipps

Not sure if this works as well:

$('td:nth-child(4)', this).text();
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top