jquery datatables adding row_selected class to a row -


I have a table that is coming up with some data. One of the pillars is a combobox in which there is information of the year. When click on the row, it is automatically selected. However, when I change the combo of the year, the selection disappears (which is normal). Whenever there is a combo change I should select the row again. Both the click functions and the combo changes function are given below:

  $ ("# rulesTable tbody"). Click (function (event) {$ (rulesTableGlobal.fnSettings (). AoData) .each (Function () {$ (this.nTr) .removeClass ('row_selected');}); $ (event.target.parentNode) .adclose ('row_selected'); var row = getSelectedRowIndex (rulesTableGlobal); var selected yuan = $ ('# ComboYear' + row + 'option: selected'). Text (); var properties id = rulesTableGlobal.fnGetData () [ Line ([']'; ' ;});   

// combo changes, attemps with all my attempts to add any of those lines to the square.

  $ ("# comboYear" + rowNo) .change (function () {var comboId = $ (this) .attr ('id'); var comboIndex = $ (this) .attr ('Name'); var propertyId = rulesTableGlobal.fnGetData () [comboIndex] [0]; var selected year = $ ('#' + comboId + 'option: selected'). Text $ ('# CalendarFrame') $ $ ('# CalendarFrame') Entit ("ComboID +" - "+ Comboindex +" + Year Selection + + "+ + Property Id)" $ .fn.upDateRow (PropertyID, Year Selected, Combo Index);) ;;;;;;;;;;;;;;;;;;;62;;;;;;;;;; ;;;;;;;;;;;) (0); $ () AddClass ("row_selected"); * / Var orjRow = $ ("# comboYear" + rowNo); //orjRow.parent().parent().addClass ("_selected "); //alert($(this).closest("tr").attr('id ')); // $ ('td: eq (0)', nRow) .addClass ('highloadRow'); / / $ (This) .parent () parent () parent (.) AddClass ('row_selected'); //$(this).closest ('tr').get(0).addClass('row_selected '); // $ (this) SS ('row_selected'); //$(this).closest('td').closest('tr').addClass('row_selected '); // warning ($ (this) .closest ("tr") parent ().); //$(this).closest("tr").get(0).addClass("row_selected "); //$(this).closest("tr").addClass("row_selected "); //$(event.target.parentNode).addClass('row_selected '); });    

OK, I could not fully understand your question, but I When you are given that class to row_selected , click on that line ( tr right?), And remove the square from the other rows If you want to do so, then it will piece the wizard :)

  $ ('# rulesTable'). Representative ('tr', 'click', function (e) {$ (this) .addClass ('row_selected'). Sister (). RemoveClass ('row_selected'); // do other things here ...} );   

Tell me that this is not what you wanted.

Comments