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

Datatables Search

$
0
0

Hi everyone,

We are using a datatable in our web page here at our company. It is working perfectly fine but 2 of our users is experiencing a bug. Wherein the search (filter and searchbox) is not working. Out of 200 users 2 of them are experiencing this issue.

Can you please help us?


Possible bug: Using tables.rows() with RowGroup extension

$
0
0

I'm working on a DataTables/Leaflet integration and I've noticed that when RowGroup is included then something seems to foul up the table.rows() function.

Here are two pages, the first does not have the RowGroup extension and it places markers on the Leadlet map just as I had expected:
http://ghsfha.org/ts_2.html

Here's the second page, the only difference aside from the header is that RowGroup is included:
http://ghsfha.org/ts_3.html

Now 1) the markers do not show up, 1) the console.log() point in the update function is never reach, and 3) a "TypeError: a is null" for datatables.min.js:197:57 is thrown.

When the any of the tables are redrawn it triggers the update function for that DataTable-Leaflet pair: "update_map_region_standings_GHSA_AAAAAAA_X" where "X" is the pairing:

.on("draw", () => {
    if (table_region_standings_GHSA_AAAAAAA_1_draw) {
        table_region_standings_GHSA_AAAAAAA_1_draw = false;
    } else {
        update_map_region_standings_GHSA_AAAAAAA_1(table_region_standings_GHSA_AAAAAAA_1);
    }
});

The update_map_region_standings_GHSA_AAAAAAA_1(table) function uses tables.rows() to cycle through the rows to get the coordinates and add them to Leaflet, but again, when RowGroup is included it doesn't work.

Is this a bug with RowGroup or should I be doing something different to cycle through the rows?

Export to excel with customize size column

$
0
0

Hi, i have some trouble and i trying to searching but not give me a solution
Is possible to set width column in datatables ?
Please tell me if anyone know about this.

Datatable not showing properly in modal box

$
0
0

Hi
I am trying to show a datatable in a modal box, which opens when user clicks a button.
Although the datatable is loading properly but its overflowing outside the modal box.

What I want to do is,
display data table in modal box properly (I am okay if it hides some of the columns and adds a (+) to expand the view ..
same as responsive mobile/tab view.

You can see the problem here

URL : http://gadhiya.in/dispatch
UNAME: kaustubh.agrawal2012@gmail.com
PWD : 12345678

After login > Click transactions > click Dispatch > Click (New) > click (Select Sauda) button on the editor form

I have checked a few things out as below, but without any success
https://datatables.net/examples/api/tabs_and_scrolling.html
https://datatables.net/forums/discussion/41870/column-width-not-working
https://stackoverflow.com/questions/25215750/datatables-does-not-becomes-responsive-on-bootstrap3-modal-dialog

Please help me with this.
Thanks.

nové webové stránky

Muchas opciones

Only for you

Här för dig


Searchbox of Data Tables not working on first load

$
0
0

Hi,
I am getting json data from server and apply that on data tables. But on first page load, the search box of DT css looks different than usual and also the search box not searching the data after typing the text. When I refresh /reload the page again its css looks normal and also it works (searching records after typing) properly. please help me.

Why the deferRender default value is set as false?

$
0
0

Hi,

Here I saw that 'Deferred rendering can be particularly useful when Ajax loading data as it allows DataTables to perform a number of performance enhancing optimisations and when deferred rendering is enabled, this can give a significant performance increase, since a lot less work is done at initialisation time.' Ultimately we all require best performance but it is noted that the default value is 'false' for deferRender option, Is there any significant issue or problem if it set as true? Or is there any other situations where this required?

Please comment. Thanks.

How to check if a cell in a certain column is empty?

$
0
0

Hello I am trying to disable tooltip if the cell is empty how can I make it? Here is my code

         "fnDrawCallback": function (oSettings) {
            $('#mtable tbody tr').each(function () {
                var sTitle;
                var nTds = $('td', this);
                var prnumber = $(nTds[6]).text();

                sTitle = prnumber;
                this.setAttribute('rel', 'tooltip');
                this.setAttribute('title', "<b>PR Number : </b>" + sTitle);
                $(this).tooltip({
                    html: true
                });
            });
          }

Problem to convert json date format

$
0
0

Hi all,

I’m facing a problem to convert json date format in jquery.

It returns this date format "/Date(1513105200000)/"

Code:

var tbl_Quot = jQuery('#tblQuot').DataTable({
        'ajax': {
            url: '../services/FilterService.asmx/Get_Quotation',
            type: 'POST',
            dataSrc: ''
        },
        language: {
            searchPlaceholder: 'Search Quotation',
            processing: 'Wait busy'
        },
        lengthChange: false,
        columns: [
            {
                'data': null,
                'render': function (data, type, full, meta) {
                    return data.QGDate;
                }
            }
        ]
    });

I'll really appreciate.
Thanks in advance
Regards

Table width seems always set at 100%

$
0
0

I've noticed that when I create a normal DataTable then the columns are stretched to fill the width of the container, but when I add Scroller then the columns have their natural width and I can adjust that with a class.

Here's an example of some tables both with and without the Scroller:
http://ghsfha.org/w/Special:SchoolHome?view=seasons&season=2016&school=Roswell

Compare the "2016 Roswell Hornets results" with the "All-State players".

I'd like to get the column widths the Scroller offers in a normal table unless I specify "width=100%".

Is it something I'm doing?

columnDefs.targets by class name not working when columns defined in JS

$
0
0

In a project I am working on, the HTML is simply an empty table. The data and columns are sent from an external ajax call. The columns are all assigned classes using className. When I try to add custom rendering to those columns using columnDefs, I am unable to use the classname of the column as the "targets". I have to specify the columns by index number. Is that working as intended?

I created a demo of the issue at http://live.datatables.net/sisigaca/1/edit The first table has columns defined by JS, and the second table has columns defined in HTML, and you can see that the Age column is formatted "properly" in the second table but not the first. I tried to make the example as close to my production environment as I could using sample data.

Modify column data from bootstrap modal

$
0
0

Hi !

I have a datatable with an edit button placed in a row with a 'bt-modal' class.
When clicking it, it displays a bootstrap modal window.

I offer an update of the informations in the given TR in a bootstrap window (there's more informations to edit with complex validity controls). So far so good, this is server side, no problem for that.

Now, where I'm stucked, is when I try to update the informations of the row in the datatable after (or before, I can handle form control client-side) the modal is submitted.

In short (ok, I should maybe have started from here, sry) : How do I reference the datatable so that I can manipulate rows/cells data from my modal ?

Below my JS declarations/functions

$(document).ready( function() {
var forSearch = $('#Tmagasins').DataTable( {
        pageLength: 5,
        [other params like kanguage and so on]
}),
        // The modal call function
            $('.bt-modal').on( 'click', function () {
            tr = this.closest( "tr" );
            magid = forSearch.row(tr).id();
            trindex = forSearch.row(tr).index();
                         //this is just for testing and yes, it works
                                     /*trdata = forSearch.row(tr).data();
                         console.log(trdata);*/
                $('.modal-body').load('dsp_magasin.cfm?id='+magid+'&trindex='+trindex);
                    $('#modModal').modal({show:true});
        })
})

P.S : My HTML setup is pretty simple, as the datatable content is populated when page is loaded; let's pretend it's a basic/static HTML one.

Thanks + sorry for my weird English ... hope you'll get what I mean :)


Count rows depending on a criteria

$
0
0

Hi,

I want to count the rows of a column, but only count if matches the criteria.

For example, we have that drawed table:

Name-Hired

James-Yes
Olivia-Yes
Paul-No
Sonya-Yes
Donna-No

The criteria is: Hired = Yes. And the result is Count = 3.

But I don't want draw anything, only count.

Thank you.

colReorder not saving state

$
0
0

I have enabled colReorder and stateSave on my datatable.
as you can see in this picture

when it loads the state the colReorder is there, but it won't actually reorder the columns, when the datatable loads. Is there anything I'm missing?

columnDefs.targets by class name not working when columns defined in JS

$
0
0

In a project I am working on, the HTML is simply an empty table. The data and columns are sent from an external ajax call. The columns are all assigned classes using className. When I try to add custom rendering to those columns using columnDefs, I am unable to use the classname of the column as the "targets". I have to specify the columns by index number. Is that working as intended?

I created a demo of the issue at http://live.datatables.net/sisigaca/1/edit The first table has columns defined by JS, and the second table has columns defined in HTML, and you can see that the Age column is formatted "properly" in the second table but not the first. I tried to make the example as close to my production environment as I could using sample data.

What happened to Quill in the online generator?

$
0
0

Has the option to include Quill been removed from the online generator?

How can I fix TypeError: i is undefined?

$
0
0

I keep getting a "TypeError: i is undefined" error(datatables.min.js:36:271). I using datatables with php. PHP outputs my data to the table.

<script>
 $(document).ready(function() {
    $('#tiles').DataTable( {
        order: [[ 2, 'asc' ], [ 0, 'asc' ]]
    } );
 });
 </script>

PHP Code

<?php foreach ($results as $row) {
                                echo "<tr><td>".$row->id."</td>";
                                echo "<td><a href='#' onclick='modTile(".$row->id.");'>".$row->tile_name."</a></td>";
                                echo "<td>".$row->detail."</td>";
                                echo "<td><img src='wp-content/themes/orchid-new/assets/img/".$row->image."' width='138' height='80' style='border:1px solid #999;'/></td>";
                                echo "<td>".$row->providers."</td>";
                                echo "<td>".$row->states."</td>";
                                    if ($row->occurring == '2'){
                                        echo "<td class='txtalign'>Yes</td>";
                                    } else {
                                        echo "<td class='txtalign'>No</td>";
                                    }
                                echo "<td title='Remove tile'><button type='button' class='delTile' onclick='DelTiles(".$row->id.");'><i class='material-icons'>delete_forever</i></button></td></tr>";
                                }
                              ?>

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Viewing all 81688 articles
Browse latest View live


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