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

Datatables ScrollY formatting inside Bootstrap panel

$
0
0

Hello,

I'm trying to add a datatable inside a bootstrap panel, which has a 6 col width unless a small screen size is used. With ScrollY enabled, I notice the column headers aren't aligned unless the row set is larger than the px value defined in ScrollY. Is there any way I can align the column headers without having a large set of data?

Here is a JSFiddle:
https://jsfiddle.net/k9rn3qaa/19/

Any help would be greatly appreciated


Problems with Bubble Editor

$
0
0

Having a two problems with the bubble editor in Bootstrap.

  1. The input and button are not lined up, the button is display a little below the line of the editor (not a different line).
  2. For the readonly field, input field is inactive but the Update button is still active!

For 1, it seems the bubble editor is not using the form-inline class, which is designed for such alignments (per Firefox inspect feature).

Server Side Processing - multiple word search

Data table Pagination

$
0
0

Hi,

I have got a scenario like i need to display the page number starting from 20. Because as my data is more I am loading only 100 data (5 per page) so totally 20 pages. I have added a new button which displays next 100 data and page number starts from 1. I want the page number starts from 20 . Is there is a way to do that??

ASP.NET Core support

$
0
0

Hi,

Any plans for creating a NuGet package compatible with ASP.NET Core?

Best regards,

Roel Alblas

multi filter select table with multiple drop down boxes (with chosen keywords)

$
0
0

This table is very nice and automatically generates items for drop down choices:
https://datatables.net/examples/api/multi_filter_select.html

But I have table cells with much content and I wish to create dropdown searches for each column with a restricted list of keywords.

Is there an example of multi_filter_select.html with self created list of search items?

Angularjs with Datatable

$
0
0

I populated data in datatable using render() . In my datatable one column is input type field so Its editable.While submit these datatable data to some REST services it should pick the edited data as well. As part of datatable data .But the issue is I am not able to find a solution that how I will fetch the each row of datatable with the edited values in it for the POST services.

datatable dynamically populated column code :

vm.dataTableInstance = $('.datatable-basic').DataTable({
data : userList,
columns : [
{ data: 'fname', title : 'First name', width: '10%' },
{ data: 'lname', title : 'Last Name', width: '5%' },
{ data: null, title : 'User Type', width: '5%',render:function(data,type,row){
return '<select data-placeholder="Select a type" id="userTypeSelect" class="select" ><option>'+userTypeList+'</option></select>';
}}
],
order: [0, "asc"],
bPaginate : false,
rowReorder: {
selector: 'td:nth-child(2)'
},
});

Datatable with select tag

$
0
0

I have created one select type column for each row in datatable. Here userTypeList is an array in which I added some datas. When the datatable is loaded the value is not populated in select type datas.

vm.dataTableInstance = $('.datatable-basic').DataTable({
data : userList,
columns : [
{ data: 'fname', title : 'First name', width: '10%' },
{ data: 'lname', title : 'Last Name', width: '5%' },
{ data: null, title : 'User Type', width: '5%',render:function(data,type,row){
return '<select data-placeholder="Select a type" id="userTypeSelect" class="select" ><option>'+userTypeList+'</option></select>';
}}
],
order: [0, "asc"],
bPaginate : false,
rowReorder: {
selector: 'td:nth-child(2)'
},
});


Angularjs with Datatable

$
0
0

I populated data in datatable using render() . In my datatable one column is input type field so Its editable.While submit these datatable data to some REST services it should pick the edited data as well. As part of datatable data .But the issue is I am not able to find a solution that how I will fetch the each row of datatable with the edited values in it for the POST services.

datatable dynamically populated column code :
vm.dataTableInstance = $('.datatable-basic').DataTable({
data : userList,
columns : [
{ data: 'fname', title : 'First name', width: '10%' },
{ data: 'lname', title : 'Last Name', width: '5%' },
{ data: null, title : 'User Type', width: '5%',render:function(data,type,row){
return '<select data-placeholder="Select a type" id="userTypeSelect" class="select" ><option>'+userTypeList+'</option></select>';
}}
],
order: [0, "asc"],
bPaginate : false,
rowReorder: {
selector: 'td:nth-child(2)'
},
});

DT 1.10 Reload Static Table

$
0
0

Hi,

Is there an equivalent to

oTable.ajax.reload();

for a static html table ?

Thanks,

Marc

Child Row data from Mysql

$
0
0

Hi All,

I have searched this forum + google but not getting my head around this.

I want to use the rows functionality as shown here https://datatables.net/examples/api/row_details.html

But i need to be able to populate the rows with data from a mysql database query. I cant figure out how to do this.

Has any one got a working example of this please that I can follow and learn?

Thanks!

Regards,
R

adding facebook comments to datatables

$
0
0

Hi,

I am trying to give a css pop up on every row so that clients can add a 'comment' using facebook. At this point if I comment on row1 then it appears on every other row if I go to that row and click comment which opens a css popup and shows the comments.

I am tyring to follow this http://socialmouths.com/2012/02/16/add-facebook-comments-to-your-blog/

It all works until I add '

” data-num-posts=”10″ data-width=”550″>

'. Then it breaks.

Has any one succesfully implement social plugins and if yes can you please share? :)

Thanks!

Regards,
Rajesh

Filtering Datatables based on the date value of last 30 days or last one year

$
0
0

Hello,
I have a datatable which has a column having date values. Now I need to have a two checkboxes. Upon clicking checkbox 1, I want the table to show entries filtered by last 30 days based and upon clicking checkbox 2, I want the table to show entires filtered by last one year.
Any suggestions/ directions, how can I do that?

How to set same hyperlink for multiple columns?

$
0
0

I have 2 columns that I want to be linkable, I want link to be related to the data of first column. Here's my code:

        $(document).ready(function() {
        var json=JSON.stringify({{ suppliers_all | safe }});
            $('#mydata').DataTable( {
                  "data": JSON.parse(json),
                    "columns": [
                        { "data": "number" },
                        { "data": "name" },
                        { "data": "classification" },
                        { "data": "location" },
                        { "data": "product_family" },
                        { "data": "category" },
                        { "data": "competence" },
                        { "data": "updated" }
                    ],
                      "columnDefs": [ { //link clickable
                        "targets": [0, 1],
                        "data": "number",
                        "render": function ( data, type, full, meta ) {
                          return '<a href="'+data+'">'+data+'</a>';
                        }
                      } ]
            } );

        } );

Problem is with the return '<a href="'+data+'">'+data+'</a>'; which returns NAME instead of NUMBER for the second column. How do I use the first column data for both columns when generating a link?

large number of columns export in pdf.

$
0
0

Hello,
large number of columns are trim when exporting into pdf. Please suggest the way so that trim column should go the next page.
Please refer attached image.
Thanks in advance


Bug: originalEvent is lost when turning a page using KeyTable

Bug Report: Custom Template comes Unbound from Dom

$
0
0

Hi All,

I am intermittently experiencing strange behavior when using a custom editor template. It seems that after I submit, there's a chance I won't be able to re-open the editor. It's as though the form became unbounded from the DOM. Sometimes, it will re-open, but the form won't submit when the submit button is clicked.

Also, and this may be a server side issue, sometimes when I submit the editor form will close automatically, other times it will not. Everytime, though, the JSON seems to come back in the proper format (interestingly, the main table also seems to reload by sending off an uncommanded ajax call).

EDIT: This only seems to happen with one of the custom templates in Edit Mode. I have 2 currently in use, and will have an additional 3.

Editor error after multiple successive saves

$
0
0

I have been using datatables for about a year with great results. The only issue that I have run into is when someone is adding one record after another through editor. For example, they add a new record using editor, then another, then another one right after another. Eventually, the editor throws an error and won't let it save without refreshing the page. Has anyone seen this and can you point me in the direction toward a solution?

Export Buttons

$
0
0

I am using the following buttons definition to provide export options.

     "buttons" :
       [
          'colvis',
         {
           extend: 'collection',
           text: 'Export',
           buttons:
           [
             {
               extend: 'print',
               exportOptions: {
                 columns: [ ':visible' ]
               }
             },
             {
               extend: 'copyHtml5',

               exportOptions: {
                 columns: [ ':visible' ]
               }
             },
             {
               extend: 'csvHtml5',
               exportOptions: {
                 columns: [ ':visible' ]
                }
             },
             {
               extend: 'pdfHtml5',
               exportOptions: {
                columns: [ ':visible' ]
               }
             }
           ]
         }
       ]

I have 19 columns in the table and a variable number of rows. When I select the print button all of the data appears on the output page but the header does not adhere to the page size. The header appears every 13 rows. When I hide a single column the behavior is exactly the same except, as expected; the hidden column is not included in the output. However; if I hide 2 columns the result output only includes 9 columns instead of the expected 17. And the header row does adhere to the page size even if the layout or page size is changed.

If I use the copy or csv button the behavior is as expected and the 17 columns are present in the output and using the pdf button evokes the same behavior as the copy button. This leads me to believe that the formatting (particularly page sizing) is a problem.

I have looked at some of the examples and end up at points that I just do not understand or cannot determine how to apply. If there is an obvious problem in my use that someone can point to I really appreciate the assistance.

John

Editor1.6 bug with php5.3&JS

$
0
0

in practise, it seems that there are several bugs with editor 1.6

  1. The following code, xhr.responseJSON seems to be empty when submitting row update data. (chrome). did I missing some important depency?
Editor.prototype._ajax = function ( data, success, error )
{
    var thrown;
    var opts = {
        type:     'POST',
        dataType: 'json',
        data:     null,
        error:    [ function ( xhr, text, err ) {
            thrown = err;
        } ],
        complete: [ function ( xhr, text ) {
            // Use `complete` rather than `success` so that all status codes are
            // caught and can return valid JSON (useful when working with REST
            // services).
            var json = xhr.status === 204 ?
                {} :
                xhr.responseJSON;

2 . server side, PHP5.3, for example, [_ssp_field] is a private class method. But PHP 5.3 do not allow a anonymous function with [use (that)] to access private members of [that] (which is actually that = this) . This leads to several problems.
One of the most important problem is , when a query condition is actually a callback function, in Query::xxx_where_xxx methods it just cannot access to [Join::_join] which is a private member field, so finally a "delete from where 1=1" will be generated. This happened in our production environments and made me so sad :(

For some reasons it is difficult for us to update php version, so I'm so happy to find a library like Datatables declared supporting php5.3.

Please test editor with php 5.3 as strictly as with php5.5+, thank you very much!

Viewing all 81902 articles
Browse latest View live


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