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

keep the Editor panel open on the page

$
0
0

Hi,

I'm using Always visible editing panel example on my page and I just want to know how to make the editor panel open all the time and not closing it. I tried to remove this line editor.close(); after saving the changes or creating a new row but didn't work. Which part of the code should be changed for that?

Thanks,


inline serverside with indicator

$
0
0

Hi,
I combined two examples, inline editing with submit button AND inline editing serverside.
My goal is to add loading indicator to the button after click
the best thing I came up with is using preSubmit
However, it's weird some times works some times not. Any advice please?

how to load large number of data in datatable?

$
0
0

This my code.


When my query has top 900. it load the data.

But when i remove the top 900. there is an error.

Need to display thousands of record.

SearchPanes Nightly CDN is blank

A Update Datatable that is based on a View

$
0
0

I have a Datatable thats working nice, but I needed some extra data from the DB, that was easier to get in a MySQL View. SO I have created the view and updated my Datatable to use the View.

But I am not sure how to then link the Update/New/Delete buttons to the original data. The way I am seeing it is in a Update, when clicking a row, the modal comes up blank.

Are you able to point me at a example?

thanks

change show/hide row icons in responsive table

It is possible to have two value in single column datatable?

$
0
0

It is possible to have two value in single column datatable? I want both data: "login" and data: "user_id" as below be in one column which will carry two values which is login and user_id.

If it is possible, how to implement that way? please help and guide me.

{ data : "login",
    render: function(data){
        return  "<span title='Reset Password' onclick='reset_password(&quot;"+data+"&quot;)'></span>";
    }
},
{ data : "user_id",
    render: function(data){
        return  "<span title='Edit' onclick='edit_user(&quot;"+data+"&quot;)'></span>"+
                "<span title='Delete' onclick='delete_user(&quot;"+data+"&quot;)'></span>";
    }
}

columns: [object Object], order: [object Object] and sorting: [object Object] when using server-side

$
0
0

Hi,

I love DataTables, but I am experiencing some difficulties setting up.

I am using a Jinja2 template to display some simple data on a page.

Here's the HTML code:

{% block content  -%}

<div class="table_container">
  <table id="serverside_table" class="display" cellspacing="0">
    <thead>
      <tr>
        <th>Id</th>
        <th>Sequential #</th>
        <th>Created On</th>
      </tr>
    </thead>
  </table>
</div>

<script>

$(document).ready(function() {
    var myTable = $('#serverside_table').DataTable( {
        "processing": true,
        "serverSide": true,
        "ajax": "/invoices/serverside_table",
        columns: [
            {data: "id"},
            {data: "sequential_number"},
            {data: "created_on"}
        ]
    } );

} );

</script>

{%- endblock %}

All works fine, as you can see here:

,but when I try to sort any of the columns, it doesn't work :(

Here's the data that's returned back to the browser from the backend:

{"recordsTotal": 12, "recordsFiltered": 12, "draw": 1, "data": [{"created_on": "2020-04-26 10:18:13+00:00", "id": 1, "sequential_number": 1234}, {"created_on": "2020-04-26 10:18:13+00:00", "id": 2, "sequential_number": 1235}, {"created_on": "2020-04-26 10:18:13+00:00", "id": 3, "sequential_number": 1236}, {"created_on": "2020-04-26 10:18:13+00:00", "id": 4, "sequential_number": 1237}, {"created_on": "2020-04-26 10:18:13+00:00", "id": 5, "sequential_number": 1238}, {"created_on": "2020-04-26 10:18:13+00:00", "id": 6, "sequential_number": 1239}, {"created_on": "2020-04-26 10:18:13+00:00", "id": 7, "sequential_number": 1240}, {"created_on": "2020-04-26 10:18:13+00:00", "id": 8, "sequential_number": 1241}, {"created_on": "2020-04-26 10:18:13+00:00", "id": 9, "sequential_number": 1242}, {"created_on": "2020-04-26 10:18:13+00:00", "id": 10, "sequential_number": 1243}]}

I noticed the following inside the axaj request, and these [object Object] values seem wrong:

I am using datatables v1.10.20:

If I switch "ajax": "/invoices/serverside_table", to "sAjaxSource ": "/invoices/serverside_table" (forced legacy mode), all works just fine.

Any ideas?

Thanks


Scroller issues

$
0
0

Need to load page in last row(page).

Now, i see the vertical lines on body after loading. And, scroll to last page, stop in the middle.

Would like to load in last page, rather than scrolling.

Full demo with all my code

live.datatables.net/kamixivu/1

use:
boostrap
font awesome
datatables
scroller

Multiple-select in one column or container using Search Panes

$
0
0

Hi Guys!

First time asking question in the forum. I'm new to this so bare with me.

Is it possible to have a multiple selection of data in one column or container of a Search Pane?

if so how?

Thanks for any help you can give me.

FixedHeader is not responsive

$
0
0

I'm using fixed header with bootstrap, but it's not responsive. It's just .. fixed, and doesn't move right and left with the table. Any ideas why? I want it to be initiated with each column of the table, and not just get fixed by brute force.

        new $.fn.dataTable.FixedHeader( oTable, {
            alwaysCloneTop: true
        });

Table length settings

$
0
0

In my Datatables (AJAX data ) I need to get rid of change length menu and set the table to 15 rows.
Even if reading the documentation I cannot set the table to 15 row...it always shows 50 rows.
Below the code I'm trying...I've tested pageLength and length option...no success so far.
Thanks for any hint

     table.DataTable({
        dom: 'lrtip',
        responsive: true,
        autoWidth: false,
        searchDelay: 500,
        processing: true,
        serverSide: true,
        stateSave: true,
        lengthChange: false,
        //lengthMenu: [[15, 25, 50, -1], [15, 25, 50, "All"]],
        //pageLength: 15,
        length: 15,
        searchHighlight: true,
        ajax: {
            url: "<?php echo site_url('rmidev/domestic_list')?>",
            type: "POST",
            "data": function ( d ) {
                d.csrf_test_name = token_hash;
            },
            "dataSrc": function ( json ) {
                token_hash = json['csrf_test_name'];
                for(var i=0; i< json.data.length; i++){
                    json.data[i].mm = '<a href="' + controller_url + '/data/' + json.data[i].id + '">' + json.data[i].mm + '</a>';
                }
                //return return_data;
                return json.data;
            }
        },
        order: [[2, 'asc']],
        deferRender: true,
        columns: [
            {data: 'mm'},
            {data: 'ditta'},
            {data: 'tipo'},
            {data: 'motori'},
            {data: 'nc'},
        ],
        columnDefs: [
            {
                targets: [ 3, 4 ],
                orderable: false,
                searchable: false,
            },
        ],
        "language": {"url": "<?php echo site_url('assets/public/plugins/datatables/lang/dataTables.') . $actual_lang . '.lang'; ?>"},
        "pagingType": "numbers",
    });

How to show column inside column visibility from unseen?

$
0
0

My problem as below:

The column seems like within the table only, how to enable the column selection from hidden as below? Currently I need to scroll the page.

$('#Table').DataTable({
dom: 'Bfltip',
buttons: [
{ extend: 'excelHtml5' },
{ extend: 'pdfHtml5' },
{ extend: 'print' },
{ extend: 'colvis' },
]
});

AJAX sometimes fails

$
0
0

I'm experiencing a weird issue using AJAX in my Datatables...sometimes, the call to the remote script fails and I get the following error:
DataTables warning: table id = table - Ajax error. For more information about this error, please see http://datatables.net/tn/7.
The above error seems occure when the users types into the search form too fast...so the server doesn't provide the answer in short time.
I'm not asking any hint or suggestions on server side sript, of course, I'm just wondering if there is any strategy on Datatables setting to avoid such error.

Below my code, and thanks for any suggestion:

     table.DataTable({
        dom: 'lrtip',
        responsive: true,
        autoWidth: false,
        searchDelay: 500,
        processing: true,
        serverSide: true,
        stateSave: true,
        lengthMenu: [[15, 25, 50, -1], [15, 25, 50, "All"]],
        searchHighlight: true,
        ajax: {
            url: "<?php echo site_url('rmidev/domestic_list')?>",
            type: "POST",
            "data": function ( d ) {
                d.csrf_test_name = token_hash;
            },
            "dataSrc": function ( json ) {
                token_hash = json['csrf_test_name'];
                for(var i=0; i< json.data.length; i++){
                    json.data[i].mm = '<a href="' + controller_url + '/data/' + json.data[i].id + '">' + json.data[i].mm + '</a>';
                }
                //return return_data;
                return json.data;
            }
        },
        order: [[2, 'asc']],
        deferRender: true,
        columns: [
            {data: 'mm'},
            {data: 'ditta'},
            {data: 'tipo'},
            {data: 'motori'},
            {data: 'nc'},
        ],
        columnDefs: [
            {
                targets: [ 3, 4 ],
                orderable: false,
                searchable: false,
            },
        ],
        "language": {"url": "<?php echo site_url('assets/public/plugins/datatables/lang/dataTables.') . $actual_lang . '.lang'; ?>"},
        "pagingType": "numbers",
    });

Highlight custom search values

$
0
0

In my Datatables I use the searchHighlight plugin to highlight the search values...I find it useful.
Now I'm trying to get rid of the standard search form and replace it with custom form/search.
The custom form seems working fine...but the searched values are not highlighted into the Datatables...is there a way to fix the issue?
Thanks a lot for any help.
Below the custom search code:

table.DataTable({
        dom: 'lrtip',
        responsive: true,
        autoWidth: false,
        searchDelay: 500,
        processing: true,
        serverSide: true,
        stateSave: true,
        lengthMenu: [[15, 25, 50, -1], [15, 25, 50, "All"]],
        searchHighlight: true,
        ajax: {
            url: "<?php echo site_url('rmidev/domestic_list')?>",
            type: "POST",
            "data": function ( d ) {
                d.csrf_test_name = token_hash;
                // Read values
                var keyword = $('#exampleInput').val();
                d.keyword = keyword;
            },
            "dataSrc": function ( json ) {
                token_hash = json['csrf_test_name'];
                for(var i=0; i< json.data.length; i++){
                    json.data[i].mm = '<a href="' + controller_url + '/data/' + json.data[i].id + '">' + json.data[i].mm + '</a>';
                }
                return json.data;
            }
        },
        order: [[2, 'asc']],
        deferRender: true,
        columns: [
            {data: 'mm'},
            {data: 'ditta'},
            {data: 'tipo'},
            {data: 'motori'},
            {data: 'nc'},
        ],
        columnDefs: [
            {
                targets: [ 3, 4 ],
                orderable: false,
                searchable: false,
            },
        ],
        "language": {"url": "<?php echo site_url('assets/public/plugins/datatables/lang/dataTables.') . $actual_lang . '.lang'; ?>"},
        "pagingType": "numbers",
    });
};

Trouble with jQuery 3.5.0

$
0
0

I just want to notify other people that I ran into a little bit of trouble with the newest version of jQuery combined DataTables Editor. In my case the multi-value div block was not inserted into the field of the editor when I edited multiple rows at once that have different data in theses fields. Rolling back to jQuery 3.4.1 fixed this issue. I think it has to do with the security fix in 3.5.0 since it has something to with HTML insertion into the DOM.

Sorry that I can't provide an example right now because I'm on a deadline.

Changelog is here: https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/

Buttons extension disable with html attribute

$
0
0

Hi, the buttons extension disables the buttons only by the class "disabled". Therefore, the default behavior like focusing, tabbing, clicking, ... remains.

button().disable() or button().enable(false) should also set the html disabled attribute like:

<button class="dt-button disabled" tabindex="0" aria-controls="example" type="button" disabled></button>

Also the tabindex could be updated (remove it or set it to -1).

Example 'Responsive integration' for Editor-Plugin not working

How to set stateSave only for ColReorder?

$
0
0

Hi,

Datatable is really great! I'm happy with it.

I want to stateSave ColReorder without other store state information such as pagination position, display length, filtering and sorting. How can I do this?

Thanks

AntiXssLibrary, Version=4.3.0.0, Culture=neutral, PublicKeyToken Error

$
0
0

Hello,

I am using datatable editor. I get this error when I leave a column empty. There is no problem when I fill it.

An example column:

                      .Field(new Field("Price")
                      .Validator(Validation.Numeric())
                     .SetFormatter(Format.IfEmpty(null)))

Viewing all 82286 articles
Browse latest View live


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