datatables

Datatables - Is it possible to download only the data that is shown as CSV?

梦想与她 提交于 2019-12-25 01:46:29
问题 I know that datatables allow you hide columns and filter rows. Tabletools allow users to be able to download the table data as CSV. However, it seems that it downloads everything. Is there a way to only download what is shown? What I mean by this is after filtering entries and/or hiding columns, is it possible to download that data result only? 回答1: Yes, look at ajax buttons mColumns option : This parameters defines which columns should be used as the data source for the export. The parameter

Prevent multiple ajax calls from jquery datatable on server side pagination

谁都会走 提交于 2019-12-25 01:45:36
问题 I have a jquery dataTable which sends a request to MVC controller using ajax and displays the data. It works fine with client side processing but response time is too slow because it retrieves all the records. To make it faster server side pagination is required. The issue with server side pagination is that setting server side pagination to true in jquery datatable it makes multiple ajax requests. I have been debugging it a lot but cant figure the problem which causes multiple ajax requests.

Datatables server side processing draw parameter

我们两清 提交于 2019-12-25 01:17:10
问题 In the datatable draw parameter documentation said is strongly recommended for security reasons that you cast this parameter to an integer, rather than simply echoing back to the client what it sent in the draw parameter, in order to prevent Cross Site Scripting (XSS) attacks How can cast a parameter to int can help to prevent Cross Site Scripting.? 回答1: You aren't supposed to do anything with it :-). On the client-side it is dealt with automatically by DataTables. On the server-side all you

jquery mobile not passing event down correctly

▼魔方 西西 提交于 2019-12-25 00:43:10
问题 I seem to have a weird problem with intelxdk and jquery mobile. If I select an element, the scrolling works fine. If nothing is selected, then the touch event is registered properly. This is best explained through the attached two images. How do I get it to focus properly? .focus() doesn't work. Please see the attached to pictures for clarity. Here the scrolling doesn't work. Here the scrolling works. It's almost as if the event is not propogated down all the way. Edit As requested by Tasos,

How to submit button info into selected table?

♀尐吖头ヾ 提交于 2019-12-25 00:21:07
问题 I want to be able to select a table cell then press a button to submit order data into the data cell thats selected. so when ordering someones food you select the table cell of the persons order then press the button corresponding with the item to be ordered and display it in their order cell (called type) function openCity(evt, menuName) { // Declare all variables var i, tabcontent, tablinks; // Get all elements with class="tabcontent" and hide them tabcontent = document

Intermitient “Cannot reinitialise DataTable” error

冷暖自知 提交于 2019-12-25 00:09:10
问题 I am making a project with a DataTable (https://datatables.net) and the issue I am having is pretty strange. Sometimes when I load the page, everything works 100% and other times when I load the page I get this error from DataTables in a popup: DataTables warning: table id=resdatatable - Cannot reinitialise DataTable. For more information about this error, please see http://datatables.net/tn/3 As I have said, there's no sure fire way to trigger this. If I hit refresh sometimes it will work,

How to create a specific html structure for datatables search bar?

谁说胖子不能爱 提交于 2019-12-24 21:15:48
问题 I'm trying to add this structure to the searchbar: <div class="app-search"> <form> <div class="input-group"> <input type="text" class="form-control" placeholder="Search..."> <span class="mdi mdi-magnify"></span> <div class="input-group-append"> <button class="btn btn-primary" type="submit">Search</button> </div> </div> </form> </div> Actually I tried to add this code to my datatables : $("#example-datatable").DataTable({ keys: !0, "dom": '<"input-group"f><"#toolbar.dt-box">lrtip', but the

How to create jquery data table from JSON array without declaring columns

痴心易碎 提交于 2019-12-24 20:54:25
问题 I have following code which gets JSON from WebAPI.(for clarity of the question, I have defined the array as data from web API). I need the data table to be dynamic and that's why I am creating the table headers at run time. This works fine, but I do not see any data on data table and get the error: DataTables warning: table id=tableId - Requested unknown parameter '0' for row 0, column 0. For more information about this error, please see http://datatables.net/tn/4 var data = [{ "Number":

DataTables - how to filter across multiple columns?

≡放荡痞女 提交于 2019-12-24 20:07:58
问题 I'd like to be able to filter by multiple columns using DataTables. Right now I'm using fnFilter() to filter, but its column parameter seems to only accept a single integer, not an array of columns. This is what I have so far: https://jsfiddle.net/dmcgrew/x85o0mgL/2/ In the "crest allowed" column I have a data-search attribute with either yescrest or nocrest set. I'd like to use the "Crest" checkbox to be able to filter by that as well. If I click the Pristine and Crest checkboxes I should

How to format currency in Datatables?

纵饮孤独 提交于 2019-12-24 20:06:14
问题 This is a table which display transactions, implementes using DataTables. $( document ).ready(function() { var table = $('#tbl_transaksi').DataTable( { "ajax": "data_transaksi.php", "bPaginate":true, "bProcessing": true, "pageLength": 10, "columns": [ { mData: 'username' } , { mData: 'fullname' }, { mData: 'the_date' }, { mData: 'amount', render: function ( data, type, row ) { return "Rp " + data; } } ], "dom": 'Bfrtip', "buttons": [ 'copy', 'csv', 'excel', 'pdf', 'print' ] }); }); It works.