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

dependent() on load of form

$
0
0

Hi,

I've two dropdowns in an inline datatable, the second dropdown is dependent() on the first. This all works fine except for one thing. If I load the page and immediately click on the dependent dropdown it will be blank. If I click out and in again it's fine, the change event has fired and the options are populated. Is there a way to immediately populate the cell on table load? The data is being loaded from a database so the first dropdown already has a value. I know there's a change and keyup event in the documentation, is there a list of the other events? Is there any way of manually invoking the dependent listener?

Thanks.


Is it possible to extend the pdfHtml5 button with start and end callbacks?

$
0
0

Creating PDF's can be a lengthy process with large table sizes. It would be nice to pop up and dismiss a modal to inform the user.

Ajax error when trying to return 10,000 records

$
0
0

Hi all,

I am pretty new to DataTables. I am currently receiving an error when trying to return 10,000 records. I can return 5,000 records and everything works perfectly.

Here is my code.
https://jsfiddle.net/7e1q3oqs/

I attached my C# code in my CSS portion, sorry for the confusion that may cause.

The exact error is:
DataTables warning: table id=tblCompanies - Ajax error. For more information about this error, please see http://datatables.net/tn/7

The LoadCompanies() method runs in 2.4 seconds, so I don't think it's poorly performing query. Any help would be very appreciated.

How can i add dynamic field datatables editor ?

Custom Filtering

$
0
0

Im using yadcf 1.10 and im trying to do the following:

i have a multi_select filter above some Columns and i want that only those rows are shown, which DONT contain the selected values.

Example:

| col1 |

| apple |
| beer |
| plant |
| tree |
| meat |
| fish |
| tree/beer |
| meat/apple |

==> i select apple AND beer:

| col1 |

| plant |
| tree |
| meat |
| fish |
| tree/beer |
| meat/apple |

==> cleared search and now selecting tree AND beer AND meat AND fish:

| col1 |

| apple |
| plant |
| meat/apple |

How can i do this server-side?

FixedHeader column width not calculating properly with multi column headers

$
0
0

Here is a minimal example, note the addition of a multi column header: http://live.datatables.net/ladekogo/1

If you expand these rows to take up enough space to add a vertical scrollbar to the page, and scroll down, FixedHeader does not calculate the proper column widths and the column headers resize as a result.

How can I fix this?

I am also having a problem where the fixedheader width is incorrect if the datatable initially takes up less than 100% of the width of the page and a scrollbar is then added, but I've solved that for now by calling table.fixedHeader.adjust() on a fast enough timer that it doesn't really matter to the end user. Is there a correct solution?

Thanks!

Datatable are too slow while loading more than 5000 rows from server

$
0
0

Hi Allan, I am working in one company where we have database of over 35k rows and we are fetching more than 5000 rows for admin panel but it take around 20 to 30 sec. before when rows are not more then it take around 5 sec.
We have two database servers for two various admin panel and one has less rows which take less time to load data but one have large data set which take more time to load all data.
We are using datatable version 1.10.7 and send ajax call for PHP file which take data from database and send it on json format and then we are displaying it on panel.

Can you suggest what to do ?

Print by passing ID

$
0
0

I'm new to Data Table, so please point me in the right direction.

I'm using Coldfusion to generate a customized report in PDF. At the Datatable, I would like to print a one page report for each of the records. So instead of printing one report at a time, I would like to have a button next to the 'excel' button called 'custom print' that would call the coldfusion file and perform a batch print by passing all of the ID's to the test_page.cfm page. What is the best way of doing this. Thanks.

For each row, my code is shown below.

{ "data": "ID",
"fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
$(nTd).html("<a href='test_page.cfm?p="+oData.ID+"'>"+"Schedule"+"</a><br><a href='dd1970.cfm?comid="+oData.ID+"' target='_blank' >"+"Print DD 1970"+"</a>"); }
},


DataTables render very slowly

$
0
0

Scenario:
Sample taken from the datatable.net example section whose markup has about 70 rows, so not pretty much.

Issue:
Desktop: It takes up to two seconds, from the time the initial table is seen and until it is fully rendered.
On mobile: It can take up to 8 seconds until the table is rendered, but usually takes 6s. During this time I cannot do anything on the page, the ui is frozen.

What could this be? This only happens on the datatable page nowhere else.
I found a 5 year old question on SO which describes the issue:
stackoverflow.com/q/7630780/2581562

2 seconds on desktop is already unacceptable, but 8 seconds is ....

So there is no ajax or whatever involved, the data is static HTML.

Unable to add additional columns due to ajax error

$
0
0

Hello!

At the moment I'm attempting to add another column to my page. However, I will get an ajax error whenever I do. It's fine with 10 columns, but as soon as I add the 11th, the ajax error will appear.

Here's my debugger
http://debug.datatables.net/ewolon

And the console error shows:
responded with a status of 403 (Forbidden)

Datatable aoColumns bSearchable

$
0
0

Hi. I want to add the searchable mode to some columns table, but It's not working. Here is my code:

 var tableM = $('#tablaPersonasAsistentes').DataTable({
            "bFilter": true,
            "serverSide": true,
            "processing": false,
            "sPaginationType": "full_numbers",
            "sAjaxSource": "@Url.Action("LoadTables", "Inscripto")",
            "fnServerParams": function (aoData) {
                aoData.push({ "name": "evento", "value": @ViewBag.Evento });
            },
            "destroy": true,
            "order": [[2, "desc"]],
            "aoColumns": [
                            { "mData": "Persona.Nombre", "bSearchable": false, "bSortable": false },
                            { "mData": "Persona.Apellido", "bSearchable": false, "bSortable": false },
                            { "mData": "Persona.Email", "bSearchable": true, "bSortable": false },
                            { "mData": "Persona.Celular", "bSearchable": false, "bSortable": false },
                            { "mData": "Empresa", "bSearchable": true, "bSortable": false },
                            { "mData": "Tipo", "bSearchable": false, "bSortable": false }

            ],
            "aoColumnDefs": [{
                "aTargets": [6],
                "mRender": function (data, type, full) {
                    return '<a href="#" class="btn btn-primary ImprimirTicket" data-id="' + full.Persona.Id + "-" + "@ViewBag.Evento" + '" data-codigo="">Imprimir</a>'
                    }
                },
                    {
                        "aTargets": [7],
                        "mRender": function (data, type, full) {
                            return '<a href="#" class="btn btn-primary EnviarCertificado" data-id="' + full.Persona.Id + '" data-evento="' + @ViewBag.Evento + '">Enviar Certificado</a>'
                        }
                    }
                ],
                "fnPreDrawCallback": function () {
                    // gather info to compose a message
                    $('#loading').show();
                    return true;
                },
                "fnDrawCallback": function () {
                    // in case your overlay needs to be put away automatically you can put it here
                    $('#loading').hide();
                }
        });

I don´t have a URL with the current code. Sorry for my english, I'm not a native speaker.

table filters from imported excel data table

$
0
0

hi, i imported excel table with filters but filters dont work on the table once imported to the site. any suggestions please?
I am not a coder. thanks. kevin.

print/pdf

$
0
0

i am using datatables with jeditable. when i edit a text field in the table it updates the database and changes the data in the table but when i either print or pdf the table the values from the original load show rather than the edited values.

How to toggle detail-control button

$
0
0

My question is related to this question: https://datatables.net/forums/discussion/40482

Specifically, I am using the following code to hide the child details when a user navigates away from the page:

        window.addEventListener("pagehide", function(e) {
            $( "tr" ).each(function() {
                var tr = $(this).closest('tr');
                var row = table.row(tr);
                if (row.child.isShown()) {
                    tr.removeClass( 'details' );
                    row.child.hide();
                };
            });
        });

My problem is that when I click the back button, the child row is hidden like I want, but the details button is still red with the minus sign. How can I toggle just the details button back to green after hiding the child? My details button is not in a separate column, but appears in whichever is the left most column. Basically I want to revert the table back to its original state upon navigating away. This is normal behavior in desktop browsers, but in mobile browsers the details remain open and appear when the user hits the back button, so I want to hide the child though my function above on pagehide and reset the details button from red back to green. Can someone help with the last part? Thanks!

Can ANYBODY make DataTables be happy on Angular 2?

$
0
0

Here's the bottom line... you can get DataTables to work in Angular 2 just fine - as long as your data is static. But if you have a real-world application where you call an Angular service to dynamically fetch your data when your component is initialized, it breaks DataTables. The table displays correctly initially. But as soon as you try to sort a column or search, all of the data disappears.

I was able to implement a really ugly work-around (hack) by delaying the application of the DataTable() call via a setTimeout - essentially giving Angular time to manipulate the DOM before DataTables does. But this is undesirable for a number of reasons.

I was hoping that Angular-DataTables (a bridge between the two) would solve the problem. And while I do like some things about it, this particular problem does not go away.

I understand that this is not an Angular 2 support forum. But given the popularity of that platform, I would think that the DataTables team would have some interest in making it work properly on it.


Unable to find row identifier - Error on editor

$
0
0

Hi

I have created a table with 5 columns. I use:

var t = $('#tblvia').DataTable();
        t.row.add( [
            row[0],
            row[1],
            row[2],
            row[3],
            row[4]
        ] ).draw(false);

Which adds the new row perfectly.

I want to be able to utilise the features from Editor for inline editing the content of this table. The table is dynamic and not pulled from a data source.

I have setup my table and also setup the Editor as follows:

editor = new $.fn.dataTable.Editor( {
        table: "#tblvia",
        idSrc:  "id",
        fields: [ {
                label: "Postal Name:",
                name: "postal_name"
            }, {
                label: "Address 1:",
                name: "address1"
            }, {
                label: "Address 2:",
                name: "address2"
            }, {
                label: "Town:",
                name: "town"
            }, {
                label: "Postcode:",
                name: "postcode"
            }
        ]
    } );

    $('#tblvia').DataTable({
        columns: [
            {name: "postal_name"},
            {name: "address1"},
            {name: "address2"},
            {name: "town"},
            {name: "postcode"}
        ],
        "createdRow": function( row, data, dataIndex ) {
            $(row).attr('id', dataIndex);
          }
    });

But I keep getting "Unable to find row identifier" error.

Can someone please shed some light on this.

Thank you.

how to use range date with server side script ?

Dynamic Data from firebase Cloud

$
0
0

im new to Datatables.net. I left tbody tag empty because my data is comming from firebase cloud and Angular ng-repeat is used to populate data. dats shows correctly but Datatables consider all rows as ONE. as it shows at footer "1 of 1 rows of 1 entries". Tell me where im wrong

DataTable edit inside an Editor modal possible?

$
0
0

Is it possible to include a datatable inside on editor modal? And also have that datatable allow inline editing? My use case for this is I have a table of records, and each record has a field which satisfies a one to many relationship. This field can then be represented by another table which I would like to be able to edit, but do so within the modal editor which is being used for the remainder of the fields of the current row/record. I hope that makes sense.

How to invoke Export, Print button on click functionality for bootstrap buttons

$
0
0

Hello,

I just want to know to invoke on click functionality of datatables button to my bootstrap buttons , without initializing datatables buttons.?

on click of bootstrap button Export or print of Datatables should work.

I am defining like this
datatableID.buttons('.buttons-print').trigger();

But for this to work there should be datatables buttons initialised which i dont want.

Can anyone help my out regarding this. ?

Thanks

Viewing all 81385 articles
Browse latest View live


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