datatables-1.10

I need an event fired after successful export on DataTables 1.10

Deadly 提交于 2019-12-02 16:04:17
问题 I'm using DataTables 1.10.4 and I would like to make an action, like a javascript function, after a successful Excel export. Is it possible, since the button is using Adobe Flash? 回答1: See the documentation. Below an example with Excel-button : ... "oTableTools": { "aButtons": [ { "sExtends": "xls", "fnComplete": function ( nButton, oConfig, oFlash, sFlash ) { alert( 'Excel-export complete' ); } } ] } ... 来源: https://stackoverflow.com/questions/26979826/i-need-an-event-fired-after-successful

datatable tools copy, pdf. csv, excel export didnt work. only print is working

爱⌒轻易说出口 提交于 2019-12-02 13:21:14
im using datatables for my front end requirements and it works good except im having an issue in exporting stuff e.g. copy, csv, excel and pdf, only print is working. Any ideas, clues, thoughts, help, suggestions, recommendation? I'm using version 1.10.6 I did link all the necessary libraries e.g. datatables js, css and datatables tools js. Below is my code for activating it on my script $('#cigptable').DataTable( { "pagingType": "full_numbers", "dom": 'T<"clear">lfrtip', "tableTools": { "sSwfPath": "../../../plugins/datatables/extensions/TableTools/swf/copy_csv_xls_pdf.swf" }, "oLanguage": {

Special characters in DataTable column names in JQuery/Javascript

别说谁变了你拦得住时间么 提交于 2019-12-02 13:16:04
EDIT : I have created this fiddle that shows the issue. I define my columns the following way (pseudo-code, please don't tell me to declare the variables) var cols = []; cols.push({ data:theNameWithSpecialCharacters, title:theNameWithSpecialCharacters, render: $.fn.dataTable.render.number(",",".",3) }); myDataTable = $('#theDataTable').DataTable({ columns: cols, data: someDataInCorrectFormat }).draw(); The datatable is correctly rendered but it doesn't show the values for the columns where there are some special characters ( [ and ] in my case) in the column names. Any and all help welcome. If

Using DataTables, how to specify an element inside a <td> to be searched

我的未来我决定 提交于 2019-12-02 03:27:33
问题 I'm using jquery DataTables, and I have a table with cells, each <td> contains a <span> and a hidden <select> , now all I want is to filter on just the text inside the <span> not the whole content of the <td> which also contains the hidden <select> element. I'm using basic DataTables configuration: $(document).ready( function () { $('#table_id').DataTable(); } ); I've been trying for a couple of days now on this site, Datatables site , googling, but couldn't find an answer, so please help

Using DataTables, how to specify an element inside a <td> to be searched

微笑、不失礼 提交于 2019-12-02 02:00:43
I'm using jquery DataTables, and I have a table with cells, each <td> contains a <span> and a hidden <select> , now all I want is to filter on just the text inside the <span> not the whole content of the <td> which also contains the hidden <select> element. I'm using basic DataTables configuration: $(document).ready( function () { $('#table_id').DataTable(); } ); I've been trying for a couple of days now on this site, Datatables site , googling, but couldn't find an answer, so please help Thanks in advance The code is generated on server, but the resulting table is something like this: Please

How to fix scrollX movement issue in jQuery DataTables on mobile devices?

若如初见. 提交于 2019-12-01 17:27:58
I have used below code to simulate fixed header with vertical and horizontal scroll bars. See example on jsFiddle . $('#liveTable').dataTable({ 'bSort': false, 'destroy': true, 'aoColumns': [ { sWidth: "85px", bSearchable: false, bSortable: false }, { sWidth: "75px", bSearchable: false, bSortable: false }, { sWidth: "80px", bSearchable: false, bSortable: false }, { sWidth: "80px", bSearchable: false, bSortable: false }, { sWidth: "85px", bSearchable: false, bSortable: false }, { sWidth: "70px", bSearchable: false, bSortable: false }, { sWidth: "70px", bSearchable: false, bSortable: false }, {

Desired page in pagination with DataTables

落花浮王杯 提交于 2019-12-01 11:16:27
I am using jQuery DataTables plugin on my table. I am getting pagination with "Previous", "Next" and all page numbers. But my requirement is I need to have a textbox in which I can enter the number, which will take to the entered page number. Here is my jsFiddle: https://jsfiddle.net/8zp7vfme/2/ $(document).ready(function() { $('#example').dataTable({ "pagingType": "full_numbers" }); }); <!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> </head> <link href="//cdn.datatables.net/1.10.7/css/jquery.dataTables.min.css" rel="stylesheet" /> <script src="//cdn.datatables.net/1.10.7/js/jquery

Datatables custom filtering with server side

孤街浪徒 提交于 2019-11-30 18:37:39
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": 'Robert' } } } ); So on the page load (initial load of the DataTable) it filters for 'Robert' just fine.

How to add multiple rows in datatables jquery

痞子三分冷 提交于 2019-11-30 11:51:01
I have used https://datatables.net/reference/api/rows.add%28%29 link working but the data showing the table as [object,object] . How to show the object to string. i have used JSON.stringify(obj) its also not working. HTML <table id="exampleTable"> <thead> <tr> <th>Year</th> <th>Month</th> <th>Savings</th> </tr> </thead> <tbody> <tr> <td>2012</td> <td>January</td> <td>$100</td> </tr> <tr> <td>2012</td> <td>February</td> <td>$80</td> </tr> </table> JS $('#addRows').click(); var table3 = $('#exampleTable').DataTable(); $('#addRows').on( 'click', function () { table3.row.add( [ { "Year": "Tiger

How to get filtered Data result set from jQuery Datatable

 ̄綄美尐妖づ 提交于 2019-11-30 04:55:36
It would be great if someone help me on the issue. I am just trying to get the filtered result set from the Datatable. Below is my code. var filtered_row_data = $('#example').DataTable().column(1).search('186').data().unique().sort(); console.log(JSON.stringify(filtered_row_data)); It just returns all the rows instead of filtered values. I am using latest stable version of Datatable. Can anyone please help on this? see dataTables selector-modifiers . You are looking for {filter : 'applied'} : table.on('search.dt', function() { //number of filtered rows console.log(table.rows( { filter :