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

Datatable issues when adding rows individually and memory leaks when adding in bulk

$
0
0

Hi

We are trying to use datatable and we are experiencing issues.
If we push rows in to the table individually then we get slow running script messages
If we push rows in to the table as an array then we see potential memory issues with IE

We need the table to refresh every 60 seconds and when processing rows manually, we have tied
removing and adding, and just replacing the data of existing rows.

The data is 370k, has 23 rows and there are 550 rows.
The data is pushed to the client through an ajax call but not through the datatable's ajax/server feature.

We are using version 1.10.11

Any help would be appreciated.
Thanks.

//example of code that pushes in the array.
var tableType = function(data)
{
self.prop1 = data.prop1;
self.prop2 = data.prop2;
self.prop3 = data.prop3;
self.prop4 = data.prop4;
self.prop5 = data.prop5;
self.prop6 = data.prop6;
self.prop7 = data.prop7;
self.prop8 = data.prop8;
self.prop9 = data.prop9;
self.prop10 = data.prop10;
self.prop11 = data.prop11;
self.prop12 = data.prop12;
self.prop13 = data.prop13;
self.prop14 = data.prop14;
self.prop15 = data.prop15;
self.prop16 = data.prop16;
self.prop17 = data.prop17;
self.prop18 = data.prop18;
self.prop19 = data.prop19;
self.prop20 = data.prop20;
self.prop21 = data.prop21;
self.prop22 = data.prop22;
self.prop23 = data.prop23;
self.prop24 = data.prop24;
self.prop25 = data.prop25;
}

var updateBoard = function (data) {
var tableTypes = [];

for (var i = 0; i < data.length; i++) {
    var myType = new tableType(data[i]);
    tableTypes.push(myType);
}

dt.clear();
dt.rows.add(tableTypes);
dt.draw();

tableTypes = null;

}


How to Copy/Export ONLY current page (client side)

$
0
0

This has been really frustrating and I assume I am missing something obvious.

I am using HTML5 buttons primarily, though I am not specifying. I would like to just use the basic "buttons" code.

I have spent the last 2 hours looking for an answer to what seems like a very simple request. When you use pagination, with client side processing, copying/exporting etc gives you the entire dataset and not just the currently visible page. how do I change this so I am not given the entire dataset at once?

thank you.

Datatable shwoing incorrectly after hidden columns are shown.

$
0
0

I have a datatable where i have 8 columns 5 of them are hidden initially.When i expand to see the hidden columns width of datatable gets disturbed what i expect is when i expand the hidden columns they should just take the width as currently datatables is taking here is link to page.

https://caduceuswebs.net/datatable/

Evaluating Editor

Our scanners issue a cr/lf - can I convert that to a tab? (Rails/javascript/jquery)

$
0
0

We are using Powerscan D8330 scanners. Due to other applications they are used on, they are configured to issue a CF/LF after each scan.

I plan to download the trial after the weekend but I was wondering if anyone had any experience switching the CR/LF to a tab?

Our environment is Rails 4, All windows clients.

thanks

chris

Sort date/time with empty values

$
0
0

Hello,

I'm using 2 colums contains localized date and time (e.g.: de: 21.07.2016, 00:00; en: 07/21/2016 12:00 AM).

With moment it works as long values are present ( $.fn.dataTable.moment('L, LT'); ) , But if no value present (in my case I print only a - (minus)) the sorting doesn't work. If I remove the '-' and pring an empty "" it works as expected.

Is there a way to sort this constellation with the '-' on start or end it doesn't matter?

thx and br

pdfHtml5 Orientation/Size

$
0
0

Hello, I am invoking the pdfHtml5 button options 'orientation' and 'pageSize' to produce a print in landscape and on legal paper.

        buttons: [
            {
                extend: 'pdfHtml5',
                orientation: 'landscape',
                pageSize: 'LEGAL'
            }
        ]

The resulting PDF does in fact appear in the proper orientation and pageSize. However, the report does not expand into the additional space provided. It is sized as it would be in portrait mode. The same effect is found in the example on this website: https://datatables.net/extensions/buttons/examples/html5/pdfPage.html

Is there a way to get the full page width used? Many thanks in advance.

Copy extension to copy on a particular column using name

$
0
0

I have a dynamically generated table on the server with varying column numbers and names. I want to provide user an option to copy a particular column by name (which is always present). Somehow it is not working. It comes back with 0 records exported.

I have posted an example at http://live.datatables.net/rumewuko/1/edit

The relevant javascript portion is below. I am suspecting that my columns syntax is not write but can't say for sure?

<script type="text/javascript" charset="utf-8">
            $(document).ready(function() {
    $('#example').DataTable( {
        dom: 'Bfrtip',
        buttons: [
                        { extend: 'copy', className: 'btn btn-primary' },
                        { extend: 'csv', className: 'btn btn-primary' },
                        { extend: 'excel', className: 'btn btn-primary' },
                        {
                            extend: 'copy',
                            text: 'Copy Office',
                            className: 'btn btn-primary',
                            header: false,
                            exportOptions: {
                             columns: ['Office:name']
                            }
                        }
                 ]
    } );
} );
        </script>

Also is it possible to add some space between the buttons? Even though I have overwritten the style it seems to carry the default style and does not leave any space between buttons.


Can you use YAML instead of JSON?

$
0
0

Hello. I hope this question has not been asked before. I would like to use YAML as my Ajax data source (objects) instead of JSON. I can get it working with JSON. But when I use YAML I get the following error: "Invalid JSON Response".
Any help is much appreciated.

Can't get footerCallback using serverside... no footer in datatable

$
0
0

http://debug.datatables.net/avetam

I've copied stand footerCallback code for column totals (see debug results) but the datatable doesn't have a footer according to Firebug. Other call back functions seem to work.

Calculate age when date of birth is filled out

$
0
0

Hi,

is it possible to calculate the age immediately after the field "date of birth" is filled out and show the result right to the field?

With options “message” or “fieldInfo” it possible to add texts left or below the field.

How is possible to put them right to the field and how could it calculate the age?

Thanks for any support.

Patrick

Trying to understand ColVis usage

$
0
0

I have a table with about 30 columns I would like to hide/display various columns. I have included all the appropriate JS and CSS files.
My Jquery code is

  $('#rollupTable').DataTable({
                "scrollX": true,
                "colReorder": true,
                buttons: ['colvis'],
                select: true,
                "columnDefs": [
                { "orderable": false, "targets": 0 }
                ],
                fixedColumns: {
                    leftColumns: 1
                }
            });

How do I get the buttons to display? Do I need to add definitions or does it pic that up from the table itself?

TIA

Prevent form-inline class?

$
0
0

Is it possible to prevent form-inline class when opening an hidden row with a form inside it?

Filter and searsh and sorting not worked in with angularjs

$
0
0

hi,
i am using angularjs in django template html and in that i am used data table but searching,sorting not work in that

my tempalte is

{% extends "base.html" %}
{% block ngapp %}
    ng-app="premisesApp"
{% endblock %}
{% block js %}
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>
<script src="/static/js/country_angular.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>

<script type="text/javascript">
  $(document).ready(function(){
    $('#areaTable').DataTable();
});
</script>




{% endblock %}
{% block content %}

<div class="content">
   <div class="container-fluid">
      <div class="row">
         <div class="col-md-12">
            <div class="card">
               <div class="header">
                  <h4 class="title">Premises List</h4>

               </div>
               <div class="content table-responsive table-full-width">
                  <table id="areaTable" class="table table-hover table-striped" ng-controller="PremiseCtrl">
                     <thead>
                        <tr>
                           <th>name</th>
                           <th>description</th>
                           <th>Edit</th>
                           <th>Delete</th>

                        </tr>
                     </thead>
                     <tbody>
                      {% verbatim %}

                      <tr ng-repeat="premise in premises.premises">
                        <td>{{premise.name}}</td>
                        <td>{{premise.description}}</td>
                        <td><a href="/app/edit-premises/{{premise.id}}/">Edit</a></td>
                        <td> <a href="#" ng-click="premiseDelete(premise.id)">Delete</button></td>
                      </tr>
                      {% endverbatim %}





                     </tbody>
                  </table>
               </div>
            </div>
         </div>
      </div>
   </div>
</div>




 {% endblock %}

Cannot reinitialise datatable

$
0
0

Hi,

I have a function defined like below and I am trying to use the same function in another jsp file to make the modal stay in same page. But, I get the error. I am just calling the same function without declaring jQuery('#automap_err').DataTable() anywhere in the jsp again as it is already defined in the function in another js file. Please help

DataTables warning: table id=automap_err - Cannot reinitialise DataTable. For more information about this error, please see http://datatables.net/tn/3

function refreshTable()
{
try{
var _t = jQuery('#automap_err').DataTable();
_t.draw(false);
}catch(e){}
}


Retains Scroller Data

$
0
0

is it possible to retains previously fetched data using scroller with server side processing? pretty much like facebook.

Not able to filter search automatically

$
0
0

I need to implement functionality to update searchable property value dynamically.
I am able to set option dynamically, it is setting but search is not updating.
dtObj.settings()[0].aoColumns[0].bSearchable = true;

By default, Let take column 1 is searchable.
I am changing its searchable to false.
It is not updating. I mean datatable based on this search update it is not working.

To apply this search changes, I need to clear datatable, and rebind whole data.
Then only it is working.

Is there any other option to make it work with our clearing of data.

Send PDF exported by DataTables to PHP as Base64

$
0
0

First of all great Plugin works wonders, but I have a scenario where, when a user would want to email the PDF generated by DatataTables to other users. The first idea that came to my mind was to convert this PDF to Base64 then send it to server side, lets say PHP. But how would one go around. I think it is an important feature.

Please, how to limit PDF/CSV export to max 100 records?

$
0
0

I have a fully functional DataTables setup running, with PDF and CSV export working.
Now, what I can´t seem to work out is a way to set a global limit to the export.
I want to set a limit of 100 records for all exports, meaning that even though there are 1000 results sorted the user must only be able to export a max total of 100 record (the first 100 out of the 1000 total records)

How can I that custom this?

How to limit PDF/CSV export to max 100 records?

$
0
0

I have a fully functional DataTables setup running, with PDF and CSV export working.
Now, what I can´t seem to work out is a way to set a global limit to the export.
I want to set a limit of 100 records for all exports, meaning that even though there are 1000 results sorted the user must only be able to export a max total of 100 record (the first 100 out of the 1000 total records)

How can I that custom this?

Viewing all 81388 articles
Browse latest View live


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