Good day! It is necessary to hang up event handlers for the whole row of the table Those. for events mouseover, click, mouseout for each row in the table hangs its handler. (Regardless of which cell the user has clicked / clicked on the user, the general algorithm works).
Because The label is built dynamically through JS. The following code was added during the formation:
ttable = document.createElement ('table');
row = ttable.insertRow (-1);
row.setAttribute ('mouseover', 'set_order_mouseover (this)');
row.setAttribute ('click', 'set_order_mouseover (this)');
row.setAttribute ('mouseout', 'set_order_mouseover (this)');
... cell formation code
Set_order_mouseover function:
function set_order_mouseover (el) {
alert ('1');
}
As a result of working out JS, a table is built with the following HTML code:
<table class = "uk-table" id = "history_table">
<tbody>
<tr mouseover = "set_order_mouseover (this)" click = "set_order_mouseover (this)" mouseout = "set_order_mouseover (this)">
<td> 1 </ td>
<td> 2017.03.20 14:02 </ td>
<td> NF-00000000025 </ td>
<td> Moscow, Kvesisskaya 2nd St., 18 </ td>
<td> 105120, Moscow, Syromyatnichesky 3rd Lane, 3/9 p. 1 </ td>
<td> 420 </ td>
<td> Canceled </ td> <td> 2017.03.21 15:00 </ td>
<td>
</ td>
<td>
</ td>
</ tr>
</ tbody>
</ table>
But none of the events work. What could be the error?