Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all 1816 articles
Browse latest View live

Datatables 1.9.4-- stop running script error on IE

$
0
0
I am using version 1.9.4 in my application, user is constantly getting stop running the script error on IE (8,9 etc)...

I have used the IE profiler , I have the below results : (some of the functions)

Function Count InclusiveTime (ms) ExclusiveTime (ms) AvgTime MaxTime
JScript - window script block 44,905 50,248.39 41,951.78 1.12 19,733.74
Array.unshift 1,447,666 7,249.77 7,249.77 0.01 343.74
initDataTable 1 57,201.30 6,827.91 57,201.30 57,201.30
initCreatedLeadsDataTable 1 62,888.61 5,687.32 62,888.61 62,888.61
pt 44,904 1,046.84 1,046.84 0.02 218.74
browserHandler 7 62,997.98 93.75 8,999.71 62,888.61
Array.sort 1 50,295.27 46.87 50,295.27 50,295.27
DataTable 1 50,373.39 15.62 50,373.39 50,373.39
String.replace 42 15.62 15.62 0.37 15.62

I need to know what is this array.unshift , why is taking being called so much time.
Need your assistance to resolve this error.

problem installing on localhost (I am a php ignorant)

$
0
0
Hi there,
I just aquired and downloaded Datatables and Editor.
I try to install them on my local ubuntu box.
To do so I created a mysql database with the sample data I found (mysql.sql, and data.sql).
In /var/www/DataTables
I installed /DataTables-1.9.4 and unziped Editor in its extras directory.

Now when I try to access one of the samples in /var/www/DataTables/extras/Editor-1.2.4/examples
I get an error:
DataTables warning (table id = 'example'): DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.

and in firebug the following console get message is provided:
<br />
<b>Fatal error</b>: Call to undefined function DataTables\Database\json_encode() in <b>/home/zope/key2go/datatables/DataTables-1.9.4/extras/Editor-1.2.4/examples/php/lib/Database/Driver/Mysql/Query.php</b> on line <b>55</b><br />

Now my question:
How can I debug this?
My problem is, I have NO idea about php (I only want to use php for the samples)
Tell me please if you need more infoormation about my setup.

thanks for your time
robert

ColReorder: prevent dragging any column before first column (even if first column hidden)

$
0
0
Hello Allan

I've been tinkering with ColReorder for my client: wonderful!

However, I'm seeing some small problems. My first column always contains the ID of the row record for use with some custom functionality I've implemented (access record on doubleclick, multiple options on single click...). I'm using ColVis, and the first column (ID) is hidden by default.

Now, if I drag a column to the front of my DataTable my custom functionality is broken (because it assumes that the data in the first column is the ID, and now other data is in the first column). That's the first problem. The second problem is that when I reload the page after dragging a column to the front of the table (I'm state saving via localStorage) my table is messed up. Even though the first column header will say for instance "Last Name", the data of the first column is still "ID", now visible.

My question is as follows: would it be possible to prevent dragging any column to precede the first (ID) column, even if this column is hidden?

I'd be glad to PM you a link and login details of my testcase, but I cannot post it here openly since it contains some sensitive data.
Could you please shed some light on this? Thank you thank you kindly!!

fnfilter regex limit

$
0
0
Hi

I created a multi select drop down with checkboxes for several columns in my table, when an option is check or uncheck i am calling this function

$('.multi-select', this).change( function () {
if($(this).val() === null){ // if the user has unchecked all options
oTable.fnFilter( "", $(this).parent().index());
}
else{
oTable.fnFilter( $(this).val().toString().replace(',','|'), $(this).parent().index(),true,false);
}
});

this is working fine if the user selects only two options, when a 3rd option is selected the table just shows results of the last one checked.

"option1|option2|option3"

is there a limit on number of ORs for the fnFilter ?

Thanks !

Getting column titles with row data...

$
0
0
Hi there,

Is there an example where the column titles can be retrieved and parsed at the same time as the data rows, using the server side processing option of datatables?

Cannot empty the table on server-side processing

$
0
0
Hello,

I have a datatable that has a purge button to purge the cache on a large dataset. The issue I have is that when the purge button is clicked it sends a request and this can take a few minutes to get a result returned. The table keeps the old records on the table until the new request has come back. I am trying to delete the old records so the loading indicator will be displayed so the user knows what is happening.

I have tried using:
proFormaTable.fnClearTable();
and a plugin
proFormaTable.fnFilterClear();
(http://datatables.net/plug-ins/api#how_to)

No matter what I try I cannot get the table to empty it's data so the user is sitting on a page with old data. This causes problems because some users don't know much about web and think they are using fresh data...

I am using server side processing and my debug details are: http://debug.datatables.net/usanur

Hopefully this is something stupid I am doing but for now I am completely lost. Thanks for any insight.

Jeremy


If it helps, the rest of the code for the js file is:
    $('#packagesOnly').click(function() {
        packagesOnly = !$(this).is(':checked');
//        $('#pro-forma-search-form').submit();
        filterDataTable();
    });

    $('#purge-cache').click(function() {
        purgeRequest = true;
        $('#pro-forma-search-form').submit();
    });

    // Delay search for input
    proFormaSearch.on('keyup', function() {
        clearTimeout($.data(this, 'timer'));
        var wait = setTimeout(filterDataTable, 500);
        $(this).data('timer', wait);
    });

    // Apply search filters
    $('#pro-forma-search-form').on('submit', function(event){
        event.preventDefault();
        filterDataTable();
    });

    $(window).bind('resize', function () {
        proFormaTable.fnAdjustColumnSizing();
    } );

    $(window).bind('abortRequest.beforeunload', function() {
        abortDatatablesRequest();
    });

    $('#export-excel').click(function() {
        window.open('/reports/package-pro-forma/?dateStart='+encodeURIComponent($('#date-start').val())+'&dateEnd='+encodeURIComponent($('#date-end').val()));
    });


    /**
     * Filter parent items
     */
    function filterDataTable() {
        // Clear search field
        proFormaTable.fnClearTable(true);
        var searchString = proFormaSearch.val();
        proFormaTable.fnFilter( searchString );
    }

    /**
     * Aborts the datatables request
     */
    function abortDatatablesRequest() {
        if (proFormaTable !== undefined) {
            var oSettings = proFormaTable.fnSettings();
            if (oSettings.jqXHR) {oSettings.jqXHR.abort();}
        }
    }

Error: Table 'mydb.ajax' doesn't exist

$
0
0
[DataTables Server Side PHP][1]

When I try to use the default DataTables server side script I get Table 'mydb.ajax' doesn't exist. Needless to say, no data is being returned from the db.

The code I've actually edited in that file is:

/* Array of database columns which should be read and sent back to DataTables. Use a space where
    	 * you want to insert a non-database field (for example a counter or static image)
    	 */
    	$aColumns = array('person', 'object', 'location');
    	/* Indexed column (used for fast and accurate table cardinality) */
    	$sIndexColumn = "Key";
    	/* DB table to use */
    	$sTable = "ajax";
    	/* Database connection information */
    	$gaSql['user']       = "myuser";
    	$gaSql['password']   = "mypass";
    	$gaSql['db']         = "mydb";
    	$gaSql['server']     = "mysite.com";
    	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    	 * If you just want to use the basic configuration for DataTables with PHP server-side, there is
    	 * no need to edit below this line
    	 */

Yes...I've changed the vars to the real values for user, pass, db, and server. I'm calling this file via jquery like:

$(".easy-table").dataTable(
      "bProcessing": true,
      "bServerSide": true,
      "sAjaxSource": "phpprocess.php"
    );

I'm using just what I see in that one example so maybe it's not all inclusive and I'm still missing something.

[1]: http://datatables.net/examples/data_sources/server_side.html

Adding button using fnRender and getting oObj.aData[0] bugs

$
0
0
Hi,

I'm having a hard time figuring out where is the bug in the code below :

I have a table and i add in the first column a button, as well as in the last two columns. However, it seems that the oObj.aData[1] varies with time, which is totally beyond understanding.

As you can see in the code, the first column i process uses oObj.aData[0] in the fnRender function, and oObj.aData[0] corresponds to the id from the data.

Further, i process another column, but i can't reach the id from the data : oObj.aData[0] corresponds now to the code of the button of the first column i've processed, while oObj.aData[1] corresponds to the field "day" of the data, and not "id"...

Here are the debug links : http://debug.datatables.net/eyefah

Thanks in advance for you help !


<table cellpadding='0' cellspacing='0' border='0' class='table table-striped table-bordered table-condensed' id='datatableDay1' style="margin-top:-15%">
     <thead>
				<tr>
					<th>Select</th>
					<th>Id</th>
					<th>Day</th>
					<th>Begin</th>
					<th>AM/PM</th>
					<th>End</th>
					<th>AM/PM</th>
					<th>Title</th>
					<th>Details</th>
					<th>isNow</th>
					<th>Edit</th>
					<th>Delete</th>
				</tr>
			</thead>
			<tbody>
			</tbody>
		</table>
<script>

$(function() {
	var oTable;
	var editor;
	f();	
	$.extend( $.fn.dataTableExt.oStdClasses, {
		'sWrapper': 'dataTables_wrapper form-inline'
	});
	// Set the classes that TableTools uses to something suitable for Bootstrap
	$.extend( true, $.fn.DataTable.TableTools.classes, {
		'container': 'btn-group',
		'buttons': {
			'normal': 'btn',
			'disabled': 'disabled'
		},
		'collection': {
			'container': 'DTTT_dropdown dropdown-menu',
			'buttons': {
				'normal': '',
				'disabled': 'disabled'
			}
		}
	} );
	
	// Have the collection use a bootstrap compatible dropdown
	$.extend( true, $.fn.DataTable.TableTools.DEFAULTS.oTags, {
		'collection': {
			'container': 'ul',
			'button': 'li',
			'liner': 'a'
		}
	});
});

var aj = function getSchedulesConfig(day){
		$.ajax({
			url: 'pages/administration/getSchedulesConfigJSON.php',
			type: 'POST',
			data: {value: day},
			dataType:'json',
			success: function(data){
				idTable = '';
				oTable = $('#datatableDay1').dataTable({
					//'sDom': '<\'row-fluid\'<\'span6\'l><\'span6\'fT>r>t<\'row-fluid\'<\'span6\'i><\'span6\'p>>',
					'fnCreatedRow': function( nRow, aData, iDataIndex ) {
						if(aData[8] == 1){
							$('td', nRow).css('background-color', '#dff0d8');
						} else {
							$('td', nRow).css('background-color', '#fcf8e3');
						}
					},
					"aaSorting": [[ 1, "asc" ]],
					"aoColumns": [
							{
				               "mDataProp": null,
				               "sClass": "selecting",
				               "bSortable" : false,
				               "sDefaultContent": '<div class=text-center><button class="btn btn-mini btn-success" type="button"><i class="icon-check icon-white"</i></button></div>',
				               fnRender: select
				            },
				            { "mDataProp": "id", "bVisible": true, "bSearchable": false },
				            { "mDataProp": "day", "bVisible": true, "bSearchable": false },
				            { "mDataProp": "begin", "bSortable" : false},
				            { "mDataProp": "beginAM", "bSortable" : false },
				            { "mDataProp": "end", "bSortable" : false },
				            { "mDataProp": "endAM", "bSortable" : false },
				            { "mDataProp": "title", "bSortable" : false },
				            { "mDataProp": "details", "bVisible": false, "bSearchable": false },
				            { "mDataProp": "isNow", "bVisible": false, "bSearchable": false },
				            {
				               "mDataProp": null,
				               "sClass": "modifying",
				               "bSortable" : false,
				               "sDefaultContent": '',
				               fnRender: modif
				            },
				            {
				               "mDataProp": null,
				               "sClass": "deleting",
				               "bSortable" : false,
				               "sDefaultContent": '',
				               fnRender: delet
				            },
				        ],
					'oTableTools': {
						/*'sRowSelect': 'single',
						'aButtons': [
						'copy',
						'csv',
						'xls',
						{
							'sExtends': 'pdf',	
							'sTitle': 'LSM Cup 2014 : Schedules Case 1',
							'sPdfOrientation': 'landscape',
							'sFileName': 'Schedules Case 1 - LSM Cup 2014'
						},
						'print'
						],*/
						'sSwfPath': 'datatable/copy_csv_xls_pdf.swf'
					},
					'sPaginationType': 'bootstrap',
					'bProcessing': true,
					'bPaginate': false,
					'bFilter': false,
					'bDestroy': true,
					'bStateSave' : true,
					'aaData': data
				});		
				},
			error: function(data){
				alert('Ajax Failure');
			}
		});
	};
	var f = function reload(){
		aj(1);
	};


function now(id){
	$.ajax({
		url: 'pages/administration/schedulesSelect.php',
		type: 'POST',
		data: {value: id, type: 'modify'},
		success: f,
		error : function(data){
			alert('Please try again : ajax failure');
		},
	});
}

function unNow(id){
	$.ajax({
		url: 'pages/administration/schedulesSelect.php',
		type: 'POST',
		data: {value: id, type: 'remove'},
		success: f,
		error : function(data){
			alert('Please try again : ajax failure');
		},
	});
}
function popup_modifSchedule(id){
	$('#myModal').on('shown', function () {
    	$('#toFocus').focus();
    	$('#toFocus').blur();
	});
	
	$('#myModal').removeData('modal').modal({
		remote: "pages/administration/popupSchedulesModify.php?s="+id
	});

}

function updat(id){
	alert(id);
	popup_modifSchedule(id);
}

function deleteFromDb(id){
	$.ajax({
		url: 'pages/administration/schedulesSelect.php',
		type: 'POST',
		data: {value: id, type: 'delete'},
		success: f,
		error : function(data){
			alert('Please try again : ajax failure');
		},
	});
}

function select(oObj){  
        // I'm relying on id being in column 0, but I could just as well used
        //  oObj.aData[oObj.iDataColumn]; // since this column also has the ID value
     var id = oObj.aData[0];
     var isNow = oObj.aData[8];
     if(isNow == 1){
     	return "<a onclick='unNow("+id+")' class='selecting' style='cursor: pointer;'><div class=text-center><i class='icon-remove'></i></div</a>";;
     } else {
     	return "<a onclick='now("+id+")' class='selecting' style='cursor: pointer;'><div class=text-center><i class='icon-check'></i></div</a>";
     }
     
}

function modif(oObj){  
        // I'm relying on id being in column 0, but I could just as well used
        //  oObj.aData[oObj.iDataColumn]; // since this column also has the ID value
     var id = oObj.aData[0];

     return "<a onclick='updat("+id+")' class='modifying' style='cursor: pointer;'><div class=text-center><i class='icon-pencil'></i></div</a>";
}

function delet(oObj){  
        // I'm relying on id being in column 0, but I could just as well used
        //  oObj.aData[oObj.iDataColumn]; // since this column also has the ID value
     var id = oObj.aData[1];

     return "<a onclick='deleteFromDb("+id+")' class='deleting' style='cursor: pointer;'><div class=text-center><i class='icon-trash'></i></div</a>";

</script>

manually redraw data

$
0
0
Hi,

Is there any way to reload aData to html without any of API call that requires data manipulation or so?
i.e. if row was modified by user with no fnUpdate call and i want at some moment set back html cell/row data to aData which was not really changed.

i could not find a way nearly fnDraw/ReDraw space and so im temporary using manual aData elements rotation with fnUpdate bRedraw overhead.

On-delegated click event and fnGetData

$
0
0
Hi all,

Disclaimer: I'm fairly new to javascript, jquery and datatables and at the moment am relying on stitching together code in the examples to get somewhere close to what I want to do.

I have a number of datatables, each within jqueryui tabs, displaying different views on the same database. So far so easy. The problem is that I need to be able to select a row, extract data (i.e. keys) from hidden columns and pass those data to jqueryui modal dialogs. I'm struggling with the hidden columns bit.

EDIT: forgot to mention, using dataTables v1.9.4

If I initialise my table thus:
	oTable = $('#my_table').dataTable( {
                "bProcessing": true,
				"bDeferRender": true,
				"bJQueryUI": true,
				"bAutoWidth": false,
                "sAjaxSource": './loadstuff.php',
                "aoColumns": [                        
					{ 	"mData": "t_bid", 
						"bVisible": false
					},
					{ 	"mData": "t_pid", 
						"bSortable": false, 
						"bVisible": false
					},
					{ 	"mData": "t_rn"  },
					{ 	"mData": "t_bn" },
					{ 	"mData": "t_btn"},
					{ 	"mData": "t_bx" },
					{ 	"mData": "t_by" }
					],
                "fnServerParams": function ( aoData ) {
                        aoData.push( {"name": "term", "value": "{S_UID}" } );
                }
        });
Then the columns are hidden correctly and the table displays correctly, but the data from the hidden rows is not available in the DOM, and I can't extract it using the following (which is straight from the example) - I only get the columns that actually appear in the resulting HTML.
	$('body').on('click', 'tbody tr', function() {
		if ( $(this).hasClass('row_selected') ) {
			$(this).removeClass('row_selected');
			}
		else {
			$(this).siblings('.row_selected').removeClass('row_selected');
			$(this).addClass('row_selected');
		}
		
			
		$("td", this).each(function(j) {
			console.log("".concat("value: ", j, ", value: ", $(this).text()));
		});		

	});

At the moment I've been getting by with a kludge. I've defined a style "hidden", and pushed that to the rows I want to hide.
.hidden {
	visibility:hidden;
	column-width: 0px;
}

	oTable = $('#my_table').dataTable( {
                "bProcessing": true,
				"bDeferRender": true,
				"bJQueryUI": true,
				"bAutoWidth": false,
                "sAjaxSource": './loadstuff.php',
                "aoColumns": [                        
					{ 	"mData": "t_bid", 
						"sClass": "hidden",
						"sWidth": "0px"
					},
					{ 	"mData": "t_pid", 
						"bSortable": false, 
						"sClass": "hidden",
						"sWidth": "0px"
					},
					{ 	"mData": "t_rn"  },
					{ 	"mData": "t_bn" },
					{ 	"mData": "t_btn"},
					{ 	"mData": "t_bx" },
					{ 	"mData": "t_by" }
					],
                "fnServerParams": function ( aoData ) {
                        aoData.push( {"name": "term", "value": "{S_UID}" } );
                }
        });


Then I get my table and my data but it looks ugly, leaving empty space where the hidden columns should be.

What I'd like to do is use fnGetData(), which I understand should return the whole hidden row. Then I can fetch all necessary values from the server, [do stuff] with them.

Unfortunately this doesn't send anything to the console:
	$('body').on('click', 'tbody tr', function() {
		if ( $(this).hasClass('row_selected') ) {
			$(this).removeClass('row_selected');
			}
		else {
			$(this).siblings('.row_selected').removeClass('row_selected');
			$(this).addClass('row_selected');
		}
		
		var myTable = fnGetData( this );
	        for(var i=0; i<myTable.length; i++){
                        console.log(myTable[i]);
                }
	});

... and the code from the example (http://datatables.net/api#fnGetData) doesn't register click events. Please could you provide me with some pointers as to where I'm going wrong?

Unfortunately the site presently lives on localhost, so can't link to it.

How can I hide the loading indicator when no items are returned?

$
0
0
Hello,

I finally got the loading indicator working but I have one issue with it. I have a problem with datatables not hiding the loading indicator when there are no items returned. Basically, it shows the single row that says no items but under that is still the loading indicator. is there a toggle to hide that somehow or is this logic I need to add manually?

I have
"sScrollY": 600
which gives me a fixed height for the table. So when there is a single row the
DTS_Loading
div is still visible.

Any suggestions are helpful.

I wasn't able to give a link as this is only local dev only right now and there are too many required files to get a prototype on jsfiddle. Sorry :(

Is this normal behavior? What should happen to the loading indicator when there is only 1 row and there is a fixed height. I haven't tested this yet but it seems it will always show the indicator if the results don't fill the table.

I did notice it does it here too: http://datatables.net/release-datatables/extras/Scroller/server-side_processing.html
(do a search of zzzz)

So I am guessing I need my own logic to handle this.

Thanks for any info
Jeremy

[Please Help] Row Selection with Fixed column

$
0
0
Dear Allen,

I am using datatable with fixed column plug in.
but when i click row on fixed columns, it doesn't select entire row but only selects Fixed column row.
could you please provide solution like 1. clicking fixed columns in row will select entire row or 2. disabling row select on fixed columns.

I haven't put link to test case as this is easy to produce scenario and am not working on live website. hope you will help without test case.

Thank You.

CRUD for edit table (ADD and DELETE button) but I have an error on JS

$
0
0
HI!
I want use [url=http://jquery-datatables-editable.googlecode.com/svn/trunk/index.html]this[/url] for edit my DataTables.

I have included all JS file
I have associated and ID to my table
I have declared my table whit: oTable = $('#tableToShow').dataTable().makeEditable()
I have add to toolbar with <div class="add_delete_toolbar"></div>

With Firebug I have this error (jquery.dataTables.editable.js):
TypeError: $(...).live is not a function
$(".table-action-deletelink", oTable).live("click", _fnOnRowDeleteInline);

Why?
Thanks.

Using DataTables with TableCheckable

$
0
0
TableCheckable is a jQuery plugin not much unlike DataTables. It introduces some functionality and styling for having checkable table rows.

Now, in order to use TableCheckable, on has to apply some classes to the <td> parent elements of the <input /> child elements, how would I apply classes to the element's parent? I guess I could do it dynamically through jquery (check for all td elements with an input checkbox child, but it would be better if there was some included way to do this).

My table is not tied to a server-side data source directly, but I am using PHP to load the data into the table (manually) simply because of my requirements.

The problem arises when I want to employ the AddData function. I can't say I can see a way of doing what I want, without just going back to normal tables (would take me 10x longer to develop, considering I am more or less done)...

I am also looking into utilizing HTML5's data-* attributes, is there a way to use those suckers too?

Requested unknown parameter '0' from the data source for row 0

$
0
0
I'm using array of objects - convert list of objects using GSON. In debug console it looks like this
{ "aaData" : [ 
      { "email":"EEE",  "login": "log1", "password" : "a235123151312", "id" : 1 }, 
      { "email":"EEE",  "login": "log2", "password" : "a235123151312", "id" : 1 }
 ]}
my datatable looks like this
var oTable1 = $('#usertable').dataTable({
        "sPaginationType": "bs_full",
        "bProcessing" : true,
        "sAjaxSource" : "/loadusers.html",
        "aoColumns": [
                      { "mData" : "email" },
                      { "mData" : "login" },
                      { "mData" : "password" },
                      { "mData" : "id" }
         ],
         fnRowCallback: function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
            $(nRow).on('click', function() {
              if ($(nRow).hasClass('info')) $(nRow).removeClass('info');
              else {
                    var arr = oTable1.fnGetNodes();
                    for (var i = 0; i < arr.length; i++) {
                          if ($(arr[i]).hasClass('info')) $(arr[i]).removeClass('info'); //one row per time
                    }
                    $(nRow).addClass('info');
                   }
              });
         }
    });
with html
<table class="datatable table table-striped table-bordered" id="usertable">
                            <thead>
                                <th>Email</th>
                                <th>Login</th>
                                <th>Password</th>
                                <th>ID</th>
                            </thead>
                            <tbody></tbody>
                        </table>

but I've got an error -
DataTables warning (table id = 'usertable'): Requested unknown parameter '0' from the data source for row 0
and it shows several rows but without any data.

P.S. An interesting thing - when I move ajax to .txt and read it using example with deep.txt - it works correctly


Also a question
how to ignore a column - for example password

Server Side values not getting set in DataTable..Help Please

$
0
0
At (Server Side) Java level: Here is what I am doing
responseJSONObject.put("sEcho", 3);
responseJSONObject.put("iTotalRecords",jsonArray.length());
responseJSONObject.put("aaSorting",sortingArray);
responseJSONObject.put("iTotalDisplayRecords", "25");
responseJSONObject.put("aaData", jsonArray);
resourceResponse.setContentType("application/json");
resourceResponse.getWriter().print(responseJSONObject.toString());
resourceResponse.getWriter().flush();

Javascript level:
****************
jQuery('#MyDataTable').dataTable({
	"bJQueryUI": true,
	"bServerSide": true,
	"bProcessing": true,
	"sDom": '<"H"<i><"datatables-header-length"l><"datatables-header-pagination"p><f>r>t<"F"p>',
	"sPaginationType": "full_numbers",
	"bStateSave": true,
	"sAjaxSource": "<%= viewPortletResourceURL.toString() %>",
	"fnServerData": function (sSource, data, fnCallback) {
			                         jQuery.ajax({	"dataType": 'json', 
		                                                        "type": "POST", 
                                                                         "url": sSource, 
                                                                         "data": data,
                                                                          "success": [fnCallback, someFn],
                                                                          "error": someFn
                                                                   });
                                               },
 });

So my issue I pretty sure values getting set as following Description got updated with what values I set
This gets updated:
"Showing 1 to 25 of 25 entries (filtered from 50 total entries)"
But the drop down from which user select number of pages to be displayed not getting updated also datatable is still displaying all 50 records whereas it should display 25 records. I am damn sure I am missing something here
here is JSON OBject that I am passing :(
{"aaSorting":[2,"asc"],"iTotalRecords":"50","iTotalDisplayRecords":"25","sEcho":3,
"aaData":.....}
aaData part is working just fine but none of the others are getting replicated :( please HELP ;(

I am kind of really tough deadline.....really I am beating my head off but cant find the solution, followed exactly what all the internet examples was saying but still not able to fix that...I think I am missing some property/attribute

fnDeleteRow not removing fnAddRow

$
0
0
I have some code that adds a row to the data table by passing the object into fnAddData function, the row renders perfectly. However, I have an .on('click') even that fires, reads the $(this).closest('tr') from the button that was clicked's data attribute, and attempts to delete the row on a successful ajax call. Everything works just fine except if I try to remove something that was added using fnAddData. Using the chrome debugger I can see that my jquery row object is found by the selector and is stored in the variable to be deleted. Any thoughts? This is an internal only site so I can't post a link up sorry :S (pastebin of all the js) http://pastebin.com/YYQWp2Zr

Newly created row not displayed

$
0
0
While adding new row in middle of the table, pagination entries is updated with new tr count but row is not visible in screen.
I am able to see all row in console by using
var nNodes = oTable.fnGetNodes( );
console.log(nNodes);

Please help me

Pagination not working correctly

$
0
0
http://i.imgur.com/B8GVd4D.png

That picture sums up my pagination issues!

My database consists of 29.000 records, and I am using the sAjaxSource, bProcessing and bServerSide to fit my goals.

In my PHP script, I am returning the number of records through the iTotalRecords property, as well as iTotalDisplayRecords. I've read the documentation thoroughly, but I cannot wrap my mind around why it isn't paginating correctly.

And of course a debug report: http://debug.datatables.net/uyunaf

can't get data from row

$
0
0
When I click on a row - I add class info to it.
$("#roletable tbody").click(function(event) {
    	$(oTable2.fnSettings().aoData).each(function() {
    		$(this.nTr).removeClass('info');
    	});
    	$(event.target.parentNode).addClass('info');
    });

I want to pass values from selected row(it is always only one row) to modal form when I click on
rolesedit
button.
I was trying to do like this(I check each row and in order to check data I show alert)
$("#rolesedit").click(function() {
    	var arr = oTable1.fnGetNodes();
        var item = null;
        for(var i = 0; i < arr.length; i++) {
        	if ($(arr[i]).hasClass('info')){
        		item = oTable1.fnGetData(arr[i]);
        		alert(item[0]);
        	}
        }
        $('#ErolenameInput').val(item[0]);
        $('#ERoleID').val(item[1]);
    });
But item[0] is always undefined.
I was trying something like this too
$(oTable1.fnSettings().aoData).each(function() {
    		if ($(this.nTr).hasClass('info'))
    			alert('has class' + oTable1.fnGetData(this.nTr)[0]);
    	});
but it undefined too.

What is the correct way to get data?
Viewing all 1816 articles
Browse latest View live