datatables

How to export user defined data using DataTables?

折月煮酒 提交于 2019-12-24 15:41:41
问题 I have a HTML table with a mixture of columns being hard coded values and others being set via java script functions dependant on user input. I can export the hard coded data fine, however it is the user defined values that I can't seem to pull through. Here is the sample of my project: function setSquat() { var squatMax = document.getElementById("txtSquatInput").value; var values = [0.4, //0 0.5, //1 0.6, //2 0.65, //3 0.7, //4 0.75, //5 0.8, //6 0.85, //7 0.9]; //8 var squatVal1 = values[3]

“Column Index” on a server-side processed DataTable

喜夏-厌秋 提交于 2019-12-24 15:18:31
问题 Does anyone know how to add a column index to a server-side processed DataTable? Basically like http://www.datatables.net/examples/api/counter_columns.html, but this example builds the index by client, which is not supported by using the common server-side version. The author Allan gave three hints, but actually I don't get it: Modify the data at the server (the ideal solution) Modify the data as it comes back from the server Edit the draw callback function to take into account the page start

DataTables - Column Search within child rows

╄→尐↘猪︶ㄣ 提交于 2019-12-24 15:16:03
问题 I have a datable that is using both child rows and column searching (filtering). See this Sample JSFiddle Taken from a couple DataTables Examples: Example of Child Rows - Example of Column Searching When searching a column, I would like for the results to include information inside the child row. For example, from the column searching example, the person may have multiple offices (Tokyo, London, and New York) that you could only see from expanding a child. I would like for the main row to

How to do vertical header column table in datatable JavaScript?

蹲街弑〆低调 提交于 2019-12-24 14:41:47
问题 How to do vertical header columns in datatable ? It should be as follows and working as datatble. 回答1: You are looking for something called matrix transpose in mathematics. to get transpose of a matrix/table convert rows to columns. <?php $table = [ ['Username', 'Col1', 'Col2', 'Col3', 'Col4'], ['Balakumar', 3, 2, 5, 85] ]; function printTable($rows) { foreach ($rows as $row) { foreach ($row as $value) { printf("%10s", $value); } echo PHP_EOL; } } function transposeTable($table) { $rowsCount

jQuery DataTable is not showing the data

假装没事ソ 提交于 2019-12-24 13:48:52
问题 My jQuery DataTable does not list the JSON data. Why is that? The HTML code: <!doctype html> <html lang="tr"> <head> <meta charset="utf-8"> <title>Binalar</title> <link rel="stylesheet" type="text/css" href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css"> <style type="text/css" title="currentStyle"> @import "http://127.0.0.1/HCAWebApp/DataTables-1.9.4/media/css/demo_page.css"; @import "http://127.0.0.1/HCAWebApp/DataTables-1.9.4/media/css/demo_table.css"; <

UTF8 characters not displaying properly with datatables and yadcf

落花浮王杯 提交于 2019-12-24 13:15:55
问题 I have a mysql database that is in UTF8, I've properly output the letters before but cannot make my php do so with datatables using the ajax process. I have tried various methods to get the UTF8 to show, including, changing headers, using mysql functions, and changing the json encode function, but I cannot make it work. Please help me show UTF8 properly instead of ?s. I have: temps.php My server side processing script: <?php header("Content-Type: text/json; charset=utf-8"); require( 'ssp

Datatables TableTools - Not able to find the path for sSwfPath

孤街浪徒 提交于 2019-12-24 12:39:27
问题 I am using codeigniter framework to build my web application. I need to export my table from datatables to csv and excel. But I am getting an error while loading the sSwfPath in the datatables TableTools : I have included the following libraries : <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="http://localhost/codegen/assets/js/jquery.dataTables.js" type="text/javascript"></script> <script src="http://localhost/codegen/js/jquery.dataTables

jquery datatable edit table row data using form

喜夏-厌秋 提交于 2019-12-24 12:25:35
问题 var tb = $('#example').DataTable(); $('#addRow').on('click', function() { var typeName = $("#type option:selected").val(); var amount = $("#amount").val(); tb.row.add([typeName, amount]).draw(); }); <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script> <label>Type</label> <select id="type"> <option> Type 01</option> <option> Type 02</option> </select> <label>Amount</label

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

How to export two DataTables in just one PDF file

ぐ巨炮叔叔 提交于 2019-12-24 11:37:46
问题 I'm currently using DataTables to draw tables in a webpage. I have a table which is not hidden and users can view it without problems. On the other hand, I have a hidden table which has to be exported with the not hidden table at same time. I want to be able to click on "Export PDF" in the not hidden table and generate a PDF file with both tables , the hidden and the not hidden table. Could someone help me? I'm a little confused about how to do that. 回答1: I havn't tried this but you could