Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82031

making new rows selectable

$
0
0
I am adding rows dynamically and using a great snippet from this site to make then editable. I have tried to use the same code to add a click handler to make them selectable but it does not work. How come it works for editable and not for selectable?

Here is the code:
	var aiData = oTable.fnAddData ( oRoom );
    	var oSettings = oTable.fnSettings();
    	// this bit works
    	$('td', oSettings.aoData[ aiData[0] ].nTr).editable(function(value, settings) { 
						
			var aPos = oTable.fnGetPosition( this );
			console.log (aPos);
			return(value);	}, { 
			type    : 'text',
			event   : 'dblclick',
		} );

        // the same selector with the click bind does not work - even with td replaced by tr
    	$('td', oSettings.aoData[ aiData[0] ].nTr).click(function(value, settings) { 
						
			// my func
		} );

Viewing all articles
Browse latest Browse all 82031

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>