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

Pass 'id' to Edit link in new column for user created edit page

$
0
0
I have created a column (column 0) to have a hyperlink, so that when clicked will open another page (edit.php). I would like to pass the id (which is in column 1) to a link in this manner (edit.php?id='id from column 1). BTW, using server side processing.

Here is most of my javascript, which is where I think a change would need to happen. Currently, each "Edit" link has the value of null, because the mData is null (I think).
<script type="text/javascript" charset="utf-8">
	var asInitVals = new Array();
	
	$(document).ready(function() {
		
		var oTable = $('#example').dataTable( {
		"iDisplayLength":25,
		"aLengthMenu":[[25,50,100,-1],[25,50,100,"ALL"]],
		"bProcessing": true,
		"bServerSide": true,
		"sAjaxSource": "scripts/server_processing.php",
		"aoColumns": [
              { "mData": null,
			  "mRender":function(data, type, full) {
				return '<a href="/update.php?id='+data+'" class="delete">Edit</a>';
			  }
			  },
              { "mData": 0 },
              { "mData": 1 },
              { "mData": 2 },
              { "mData": 3 },
			  { "mData": 4 },
			  { "mData": 5 }
            ],
		"oLanguage": {
				"sSearch": "Search all columns:"
		},
		} );

I am very appreciative of anyone who can offer assistance. I have searched the forums for about 2 hours, but nothing seemed to work for me. Thanks!!

Viewing all articles
Browse latest Browse all 82017

Trending Articles



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