Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all 82245 articles
Browse latest View live

Refresh function not works

$
0
0
Hello,

The fnDraw Function not works. I have this function

function DuplicaPrice(idprice){       
                
        $.get("prices.php", { idprice: idprice},

            function(data){

              alert('OK!');  
              oTable.fnDraw();              
        });    
}

but the table not refres.


My table declaration:

oTable = $('#prices').dataTable( {
            "sDom": 'l<"clear">Tfrtip',                        
            "bPaginate": true,
            "iDisplayLength": 50,
            "aaSorting": [[ 8, "asc" ]],
            "aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
            "sAjaxSource": "prices.php"
             ...
             ...
             ...


Please helpp !!
Tahnk you

DataTables 1.9.4 released

$
0
0
Hello all,

I'm really pleased to announce the release of DataTables 1.9.4. Alongside a number of bug fixes in this release, there are a number of performance improvements from Tim Tucker and jlabanca which makes reading data from the DOM and drawing when scrolling is enabled much faster.

One important note from this release is that fnRender is now fully deprecated and will be removed in DataTables 1.10. mRender is now the method to use to preprocess data for display.

With this release, development of DataTables will now shift focus to the v1.10 major release. I'm really looking forward to seeing the items that are planned for this release fully implemented, as this could be one of the biggest releases since v1. For more information about the v1.10 plans, see the DataTables roadmap: http://datatables.net/development/roadmap .

This latest release can be downloaded from the downloads page or directly with this link:
http://datatables.net/releases/DataTables-1.9.4.zip .

*edit* DataTables 1.9.4 is now available on the Microsoft CDN:
http://www.asp.net/ajaxLibrary/CDNjQueryDataTables194.ashx .

If you find any issues with this release, please *open a new thread* with a detailed description of the problem, so we can keep track of individual issues.

It takes a lot of time and effort to develop and support DataTables, so if you find it useful, please consider helping further support and development by making a donation towards the project: http://datatables.net/donate .

Enjoy!
Allan

export the data from table

$
0
0
Dear Everyone,

I am using Data Tables and putting data in to table is there any way to export that data into Excel,PDF or any format.

Please anyone help me online.

Thanks and regards,
Gajanan Hiroji.

Fixed Header with select list in header

$
0
0
OK, so I have narrowed my issue down to the Fixed Header. I have been using the dataTables control for a while now and have found it to be superb for my sites - I've got it to do just about everything I have needed but this has me stumped! I have stripped everything back to the simplest terms for testing and you can see that version here:
http://www.the-morph.co.uk/test/TrainingComps2.aspx

- It loads with the Fixed Header OFF.
- Make a selection from the drop down in the header.
- Make a selection from the drop down in row 1.
- Click 'Check Selections' and see what you have chosen - all is correct.

- Now click the checkbox to turn ON the Fixed Header.
- Make a selection from the drop down in the header.
- Make a selection from the drop down in row 1.
- Click 'Check Selections' and see what you have chosen
- The selection from Row 1 is always correct but the header selection is ALWAYS 1 instead of what you chose - huh?!

- Turn OFF the Fixed Header and all works as expected.

Any ideas would be really helpful, thank you.

Switch between regex and smart filter

$
0
0
Hello all,

Predominately, i use smart filtering which works very well for my use. However, I have received a request to enable regex filtering as an option. I was hoping to write an extra that would place a checkbox next to the global search box that would enable/disable regex filtering. The issue I have is attempting to change that functionality when checked.

The API example (http://datatables.net/examples/api/regex.html) accomplishes this task by creating a second global search box, that sends the filter command [fnFilter()] each time there is a click or keyup. As stated before, my preference is to change the default behavior. Also, I don't see an identifier on the global search box similar to the API example.

Any suggestions on how to accomplish this?

Fixed width issue, checkbox column collapse issue

$
0
0
Hey,

I'm using datatables 1.9, and using the fixed table layout property. In chrome and Safari, the checkbox column is collapsed and merged with the next column. I tried to use it on the datatables samples. Here's the example, works well in firefox, but messed up in chrome and safari.

http://bufle.com/dtable/examples/basic_init/zero_config.html

Some kind of conflict with datables, won't even load

$
0
0
I have an aspx page with many js plugin libraries.
i want to use datatables plugin.
when i add the script tag for datatables i can't even get my page to load.
take it away and everything works fine.
with the script in there i can't even get my document.ready to trip.
I'm using jquery, jqueryui, dojo (not by choice), and a host of other libs.
do i have any options to test another way?

Integrating DataTables and WordPress

$
0
0
I am creating a wordpress theme where I'm pulling a bunch of custom fields into a table that I would like to be able to sort with DataTables. Because I'm using custom fields I'm unable to use the tablepress plugin.

I've tried to install the traditional jquery plugin but it's not working. The js files are all enqueued and working correctly, but my tables haven't been pressed yet!

Anyone have any suggestions?

Footer Content calculated in fnFooterCallback not exported

$
0
0
I have a DataTable, with TableTools, where I am generating column totals in the footer using the fnFooterCallback function. While the footer content display as expected in the HTML version of the DataTables, the export to PDF (or CSV) does not include the footer data as generated in the callback.

DataTables debug bookmarklet: atamaz
DataTables 1.9.4
TableTools 2.1.4

A very basic example, with the minimal amount of code to reproduce the issue: Demonstration: http://dev-3.staging.wedu.com/ttools_test.php

my initialization and fnFooterCallback:
$(document).ready( function () {
    $('#example').dataTable( {
        "sDom": 'T<"clear">lfrtip',
        "fnFooterCallback": function( nFoot, aData, iStart, iEnd, aiDisplay ) 
        {
            $(nFoot).append('<td>Grand Totals:</td>');

            var tot = 0;
            for (var i=0; i<aData.length; i++)
            {
                tot += aData[i][1]*1;
            }
           $(nFoot).append('<td>' + tot + '</td>' );
        },
        "oTableTools": {
             "sSwfPath": "TableTools-2.1.4/media/swf/copy_csv_xls_pdf.swf"
        }
    } );
} );

my html
<table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
	<thead>
		<tr>
			<th>String</th>
			<th>Int</th>
		</tr>
	</thead>
	<tfoot>
		<tr>
		</tr>
	</tfoot>
	<tbody>
		<tr>
			<td>One</td>
			<td>1</td>
		</tr>
		<tr>
			<td>Two</td>
			<td>2</td>
		</tr>

	</tbody>
</table>


Table Tool Export buttons don't handle fnFooterCallback content correctly

$
0
0
Second post about this, previous post still 'waiting for approval' I suppose. This follow up post is because I have discovered a second problem, but it is related.

I will in this discussion also include links to a test case demonstrating the issue and the associated datatables debug code:

Test-case public link: http://dev-3.staging.wedu.com/ttools_test.php
Debug submission: http://debug.datatables.net/atamaz

For content generated in the tfoot element via the fnFooterCallback I am observing two scenarios:
1. The tfoot element is not included in the export to PDF or CSV (already reported, but post not published yet, so no link)
2. For the 'print' view ... the content in the tfoot is rendered to the screen twice.

I have provided all information I believe will allow for analyzing, and a demonstration of the issue, reduced to the minimal amount of code necessary to reproduce. Would appreciate acknowledgment of the issue report, even if a solution is not available.

Dynamically add/remove columns -> DataTables warning. Requested unknown parameter...

$
0
0
Hello Allen.

I am using a js array and passing it into dataTables using the aaData option. When my page loads, aaData contains 5 columns of data. When I initialize my datatable, I pass in aaData and aoColumnDefs which also contains 5 elements.

When the user clicks on an element in the list on the left, I retrieve data from the server using $.ajax(). The data is returned as an array of values. The values are pushed into each corresponding row of aaData and a new column definition is pushed into aoColumnDefs.

I then use the modified aaData and aoColumnDefs (containing the new elements) to initialize my datatable after I completely destroy it using fnDestroy().

Adding columns dynamically works very well in this scenario.

I am using fnDrawCallback to bind a handler to the click event of a span element that is contained within the sTitle property of column. When the span is clicked, I remove the column from both aaData and aoColumnDefs and I reinitialize my datatable using the new options for aaData and aoColumnDefs after the previous datatable is destroyed via fnDestroy and the table markup is replaced.

I am having trouble understanding why I am getting the infamous DataTables warning. Requested unknown parameter... warning since I am destroying my datatable, replacing any existing table markup in my table container, and calling .dataTable() to initialize a completely new data table using the modified aaData and aoColumnDefs arrays.

Debug link:

http://debug.datatables.net/adicin

This is really important to me. I hope you can help.

Many, many thanks.

Robert

Backbone single page application seems to break row expansion.

$
0
0
Hi All,

I've encountered an issue using Datatables in a backbone application. Basically what is happening is if I navigate directly to the data tables page once everything works fine. However, if I click out of the view rendering the table and then navigate back in (without a full page refresh...using the Backbone routing mechanism) I get the error when attempting to expand a row for additional details.

Uncaught TypeError: Cannot read property 'aoOpenRows' of null

in the chrome debugger.

Here is a link demonstrating this behavior.

http://jsfiddle.net/zundra/mrLx4/2/

"TypeError: oSettings is null" in var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex

$
0
0
Hi all, being a newbie to datatables I'm having a problem.
My table is being opened and filled depending on which link one clicks. The first time there's no problem with opening/closing the rows to show detailed info. But after clicking the other link. opening/closing the rows doesn't function anymore.
Instead I'm getting an Exception : "TypeError: oSettings is null" in:

this.fnIsOpen = function( nTr )
{
var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );
var aoOpenRows = oSettings.aoOpenRows;
......

Anyone any ideas how to solve this one?

kind regards Auke Poortman


This is my code:
 

var str="";
var oTable;
 
/* Formating function for row details */
function fnFormatDetails ( nTr )
{
    var aData = oTable.fnGetData(nTr);
    var sOut = '<table cellpadding="5" cellspacing="0" border="0" style="padding-left:50px;">';
    sOut += '<tr><td>Filesize:</td><td>' + aData.filesize + '</td></tr>';
    sOut += '<tr><td>runbatchID:</td><td>' + aData.runbatchID + '</td></tr>';
    sOut += '<tr><td>Starttijd verwerking:</td><td>' + aData.starttijdBatch + '</td></tr>';
    sOut += '<tr><td>Eindtijd verwerking:</td><td>' + aData.eindtijdBatch + '</td></tr>';
    sOut += '<tr><td>Duur verwerking:</td><td>' + aData.eindtijdBatch + '</td></tr>';    
    sOut += '</table>';
	
    return sOut;
}

$(document).ready(function() {
	 

	oTable =$('#datatable').dataTable( {
		"bProcessing": true,
		"bStateSave": true,
		"bServerSide": true,
		"bFilter": false,
		"bLengthChange": true,
		"bRetrieve": true,
		"aaSorting": [[ 1, "desc" ]],
		"fnServerParams": function ( aoData ) {
			aoData.push( { "name": "env",
				           "value": "<?php print($_GET['env']); ?>" } );
			aoData.push( { "name": "customer",
				           "value": $("#filter_customer").mcDropdown().getValue()[0] } );
			aoData.push( { "name": "filename",
				           "value": document.getElementById('filter_filename').value } );
			aoData.push( { "name": "filter_start",
		           	       "value": document.getElementById('filter_start').value } );   
			aoData.push( { "name": "filter_finish",
        	       "value": document.getElementById('filter_finish').value } );       	       
		},
		"sAjaxSource": "AJAX/datatables/Postbus_data.php",
		"aoColumns": [
			{ "mDataProp": "details_png", "bSortable": false },
  			{ "mDataProp": "date", "bSortable": true },
  			{ "mDataProp": "time", "bSortable": false },
            { "mDataProp": "customer", "bSortable": true  },
            { "mDataProp": "filename", "bSortable": true  },
            { "mDataProp": "filesize", "bSortable": true, "bVisible": false  },
            { "mDataProp": "transferstatus", "bSortable": true  },
            { "mDataProp": "runbatchID", "bSortable": true, "bVisible": false },
			{ "mDataProp": "starttijdBatch", "bSortable": true, "bVisible": false  },
			{ "mDataProp": "eindtijdBatch", "bSortable": true, "bVisible": false  },
            { "mDataProp": "batchstatus", "bSortable": true   }
        ]
	} );


	 $('#datatable tbody td img').live( 'click', function () {
	        var nTr = $(this).parents('tr')[0];
	        if ( oTable.fnIsOpen(nTr ) )
	        {
	            /* This row is already open - close it */
	            this.src = "css/images/datatables/details_open.png";
	            oTable.fnClose( nTr );
	        }
	        else
	        {
	            /* Open this row */
	            this.src = "css/images/datatables/details_close.png";
	            
	            oTable.fnOpen( nTr, fnFormatDetails(nTr), 'details' );
	        }
	    });
} );

 

I need a cell value when I click a row

$
0
0
Hello,

I have this function:

 $('#table tbody').on('dblclick', 'tr', function (e) {
        //I need the first cell value here
});

But I need the first cell of this row (inside this function). How I get a cell value when I click in the row please??
Thenk you!

Toggling Row Groupings

$
0
0
I am using row groups (via fnDrawCallback)

Problem is that I don't know how to toggle grouping on and off... I've tried calling destroy (to restore the dom state) then reinitialize the data table without this callback, but the problem is destroy doesn't seem to restore it to the true default state.

Any ideas?

Can you ignore/skip rows?(Implementing drill-down rows)

$
0
0
I'm implementing drill-down rows, but can't use the technique outlined in http://www.datatables.net/blog/Drill-down_rows (using fnOpen, fnClose) as I need the drill-down rows to be in the DOM and not added/removed (ASP.NET MVC; they contain form elements against which I'm doing unobtrusive validation, and later posting back to the server).

So essentially what I have is this:

<tbody>
    @for (var i = 0; i < Model.Count; i++)
    {
	<tr>
	    <td class="expandCollapseControl"></td>
	    <td>some value</td>
	    <td>some value</td>
	    <td>some value</td>
	    <td></td>
	</tr>
	
	<tr class="drillDownRow">
	    <td colspan="5">
		some drill down content
	    </td>
	</tr>
    }
</tbody>

Is there any way to have datatables keep all .drillDownRows in the table, but not try to parse them? Or another way to get this effect?

DataTables not calling editor.on API functions for editor.create, editor.edit, editor.remove

$
0
0
Hi,

I can't figure out why the Editor API functions aren't being used for my form. I'm using editor.add to populate the form with all the fields, and that works fine. Please see this jsfiddle to check my code.

http://jsfiddle.net/m5ySp/1/

Thanks for any help!

-Carl

Use DataTables on a ASP.NET GridView?

$
0
0
We have several GridView used in our project. We would like to apply DataTables to these GridView. Is it there a way toget the HTML from the GridView and pass it to DataTables?

problem with datatable for gridview in asp.net

$
0
0
hello, i am unable to use data table jquery for gridview in asp.net. i am not understanding how to use data table. Please help me..

Using asp.net GridView with DataTables and Large DataSets

$
0
0
I have a custom grid control that inherits from the asp.net GridView. In the OnPreRender event it evaluates custom properties on my control and dynamically builds/registers a client script to use DataTables for paging, sorting, etc. client-side. The code-behind of each aspx page sets the grid DataSource and calls the DataBind. It also implements the DataBound and RowDataBound events of the GridView to manipulate the data and/or set additional properties on each row specific to data in the row (based on user permissions or other criteria). That's my set-up.

Here's my problem. When I have large datasets (say 1000 rows and over -- we do limit total number of rows returned to 5000 at the database level), the grid takes forever (can take several minutes if it finishes at all) to render. We set our paging up to chunk rows into page lengths of 10 to 25 rows most of the time, so I really want the rows of the active page to show up quickly. I have attemped a server-side implementation using bServerSide=true and sAjaxSource="some aspx page I built" but I can't get it to work the way I need it to. Since we are using the DataTables to enhance a GridView, the grid has to render before the DataTables script can be applied. I force the render by adding one empty dummy row in the code-behind (if I don't do that then the call to my sAjaxSource never happens). When my sAjaxSource page executes I can use the request params and get the subset of data for just the page we want to display, and return it in the proper JSON format for DataTables to display it on the page just fine. EXCEPT, I only have access to the DataBound and RowDataBound events of the GridView when I add my dummy row, before I ever get to my sAjaxSource page and get my real data. So my data doesn't look right when it displays. I need access during the binding events to mask data or add links to data, etc...the data is useless without those features.

I'd really like postback behaviour on paging and sorting, but with all the bells and whistles I've become accustomed to with DataTables. Then I could limit the data to the active grid page in my aspx page before calling the databind and also have access to the binding events for my masking and linking bells and whistles.

I tried going back to strictly client-side behaviour and using the bDeferRender=true property, but the documentation is pretty specific that it only works with Ajax or Javascript datasources so I wasn't surprised that it didn't help (in fact it made have made things worse).

Any advice on some other features or properties I might want to try?
Viewing all 82245 articles
Browse latest View live


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