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

send hidden field value in makeeditable loaddata variable

$
0
0
I am a datatables newbie but hope someone can guide me in the right direction.

I am using makeeditable to generate a select box from a php function using loadurl which works just fine. The problem I am having is I need to send the id of the row to the function and I can't seem to figure out how to do it. I can create a static variable in loaddata but I can not set the value of a field to be the row id which is a hidden field in the datatable.

         var exampleTable = $('#example').dataTable().makeEditable({
         	sUpdateURL: function(value, settings)
  			{   			
                       $.ajax({
    			type: "POST",
    			url: "<?php echo site_url('quotes/ajax/edit_datatables');?>",
    			data: ""
    			success: function(){
						oTable.fnDraw();
				}
    			})
    			return value;
  			},

                 aoColumns: [
             		{ },
               		{ event: 'click', 
               		  select: 'true' 
               		},
               		{ },
               		{ },
               		{ },
               		{ event: 'click', 
               		  select: 'true' 
               		},                    				
               		{
			onblur: 'submit',
        		type   : "select",
        		loadurl: "<?php echo site_url('select/ajax/get_select');?>",
        		loadtype: 'POST',
        		loaddata: { "id":  "2" },  // should be the value of the first datatable column which is a hidden column
        		//loaddata: { "id":  oTable.fnGetData(oTable.fnGetPosition(this)[0])[0].toString() },
        		event: 'click', 
               		select: 'true'
           		},
           		{ event: 'click', 
               		  select: 'true' 
               		},
           		{ },
           	],
           });

Thanks in advance for the guidance.

Jon

Viewing all articles
Browse latest Browse all 82141

Trending Articles