datatables-1.10

Adding more drop down or html elements to Datatable in Jquery

北战南征 提交于 2020-01-02 13:37:29
问题 Is it possible to add more drop down or other html elements to the Datatable after the default Display "5" record I want to add more drop down to my DataTable between the Default one and the Search Bar which is provided by default. I have gone through sDom but I am not able to understand the syntax. Thanks in advance. 回答1: You can insert an element <div> between the length menu and the filter box this way : var table = $('#example').DataTable({ dom : 'l<"#add">frtip' }) 'lfrtip' is the

jQuery Datatable DOM positioning for Buttons

我只是一个虾纸丫 提交于 2019-12-30 08:14:17
问题 I just upgraded my jQuery Datatable version to 1.10. And then i tried to remove its retired plugin such as "Colvis" and "Tabletools" with the "Button" extension. Everything works fine here. But the problem for me is, I could not able to separate "Colvis" button from the "Tabletool" buttons. "sDom": "B<'row'><'row'<'col-md-6'l><'col-md-6'f>r>t<'row'<'col-md-4'i>><'row'p>B", "buttons": [ 'copyHtml5', 'excelHtml5', 'csvHtml5', { extend: 'colvis', postfixButtons: [ 'colvisRestore' ], columns: '0

Datatables custom filtering with server side

若如初见. 提交于 2019-12-30 06:05:32
问题 I'm using DataTables and also using server side processing (Django). I have a seperate textfield in which I use it to custom filter data in the DataTable after the table has been rendered already. The following works just fine (I want to custom filter columns): var table = $('#problem_history').DataTable( { "bJQueryUI": true, "aaSorting": [[ 1, "desc" ]], "aoColumns": [ // various columns here ], "processing": true, "serverSide": true, "ajax": { "url": "/getdata", "data": { "friend_name":

How to get current table id to add to ajax data when initialisation is used for multiple tables?

风格不统一 提交于 2019-12-25 13:19:48
问题 I have the following initialisation for multiple tables with the same class but different id attributes: var $table = $('table.jobs'); $table.DataTable({ .... ajax: { url: '/my-url', dataSrc: function (json) { return json.data }, data: function(data) { data.table_id = $table.attr('id'); // gives the same id for all tables } }, ... }); Is there a way I can identify which table is sending the ajax request? I'm trying to avoid duplicating the entire initialisation for every table. 回答1: You can

datatables dataSrc function not called on successful ajax response

前提是你 提交于 2019-12-25 04:24:51
问题 I'm using the Datatables plugin to get table data from a server using the ajax Property and transform it using the dataSrc property. My datatables definition: var my_table = $('#my_table').dataTable({ "processing": true, "serverSide": true, "ajax": { "url": "/my/url", "type": "POST", "dataSrc": function(json) { console.log('json', json); return format_my_table_data(json.data); } }, "deferLoading": found_rows, "data": initial_my_table_data, "ordering": true, "order": [[1, "desc"]], "lengthMenu

datatables show double order icon on header

扶醉桌前 提交于 2019-12-24 13:52:39
问题 I'm creating a simple table using datatables with bootstrap with this instructions var bTable = $('#example2').DataTable( { language: { url: 'assets/plugins/datatables/i18n/Spanish.json' }, processing: true, fixedHeader: true, serverSide: true, responsive:true, ajax: "modulos/estados.data.php", columns: [ { data: "id561" }, { data: "des561" }, { data: "accion561" }, { data: "res561" } ], order: [[ 1, "asc" ]], columnDefs: [ { targets : 0, searchable: false, render: function ( data, type, row

Datatables: How can I keep child rows opened after the Ajax reload

两盒软妹~` 提交于 2019-12-24 12:23:13
问题 I'm using an Ajax source to generate the table. This one is refreshed every 5000 ms and when a child row is opened it's then closed by the table's redraw. How can I keep these ones opened? My code: /* Formatting function for row details - modify as you need */ function format ( d ) { // `d` is the original data object for the row return '<p>Text in child row</p>'; } $(document).ready(function() { $('#table').DataTable( { ... } ); var tr; var row; $('#table tbody').on('click', 'td.details

building master-details grids using jquery datatable

有些话、适合烂在心里 提交于 2019-12-24 06:33:14
问题 i'm using jQuery datatable as grid now i want to display master details (orders - order details) depending on master ID (ajax call to create the detail table) all i found https://datatables.net/examples/api/row_details.html which is static string is my request possible ? thank you 回答1: You can do ajax request before render extended row info. Create a function that accept row info and callback which will render extended row info. Inside a function do ajax callback and on success call render

How to get all the td values of a Table in a javascript function

不打扰是莪最后的温柔 提交于 2019-12-24 05:35:11
问题 I have a datatable in which i am showing child rows expand collapse functionality.It is working well but i want to get the contents of last td of a table.For now i have create a function which is placing some hard coded value in the datatable expanded place . In that place i want to get those td values. ! Here is the code i am posting <html> <head> <title>Insert title here</title> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.5/css/jquery.dataTables.css"> <link

How to get all the td values of a Table in a javascript function

為{幸葍}努か 提交于 2019-12-24 05:35:03
问题 I have a datatable in which i am showing child rows expand collapse functionality.It is working well but i want to get the contents of last td of a table.For now i have create a function which is placing some hard coded value in the datatable expanded place . In that place i want to get those td values. ! Here is the code i am posting <html> <head> <title>Insert title here</title> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.5/css/jquery.dataTables.css"> <link