jquery-datatables

Retrieving visible data from Datatables

萝らか妹 提交于 2019-12-25 05:27:10
问题 I am currently using Datatables to display three columns with a varying number of rows of information. The table is setup so that when a column header is clicked the table is sorted in reference to that column. I am trying to use fnGetData to get the visible data that is now sorted. However, my attempt simply returns the original data the table was initialized with. This is a roughly what the code looks like: $("#example").click(function() { oTable = $('#' + tableName).dataTable(); var

Paging data tables in jQuery

試著忘記壹切 提交于 2019-12-25 04:35:25
问题 I have a table with more the fifty records in it. I want to display them in pages of five records per page. My current approach uses jquery datatables, as shown below. $(document).ready(function () { var length = $('#data-datatable tbody tr').length; $('#data-datatable').dataTable({ "bFilter": false, "bLengthChange": false, "iTotalDisplayRecords" : 5, "iTotalRecords": length }); }); This shows all fifty records in one page! How can I get the display I want please? 回答1: My assumptions with

Datatable Javascript Link not working on 2nd page

亡梦爱人 提交于 2019-12-25 03:43:31
问题 I have a list of data in a table and am using the dataTable plugin for pagination. However, my last column is a link. When I go to the 2nd page I cannot click the link, but the link opens only on the first page of the table. When I did not have the datatable all the linked work, but it was when i added this it didnt work... My code: <table id="PartsResultListGrid" class="table table-striped table-bordered"> <thead> <tr> <th> @Html.DisplayNameFor(model => model.PartsRequestOrderNum) </th> <th>

aDataSort error of undefined or null reference for diffrent columnlist

浪子不回头ぞ 提交于 2019-12-25 01:49:20
问题 I have integrated datatable for the result set for the fixed columnlist and it's working fine. The issue am facing currently is, based on the selection of the dropdownlist, I want to load different columnlist with the search result. But when I'm trying to do, it will give error of aDataSort error of undefined or null reference if the columnlist / result set are empty. So is there any solution to disable "DataSort" property from the datatable property? I ahve tried by assigning, "aaSorting":

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

DataTables: Uncaught TypeError: Cannot read property 'length' of undefined?

喜夏-厌秋 提交于 2019-12-24 18:00:33
问题 So, here is my AJAX call for the DataTables table object. I am trying to get the JSON to fill in a table with rows only, as it already has header rows. I am not clear as to what the syntax of the DataTables ajax calls are, as they differ from one version to the other. $('#MainContentPlaceHolder_business_return_flights').dataTable({ "ajax": { "url": "Browse.aspx/GetBusinessFlights", "type": "POST", "contentType": "application/json; charset=utf-8", "dataType": "json" } }); I keep getting the

JSON error on using jquery datatable

放肆的年华 提交于 2019-12-24 15:20:06
问题 [{"name":"aaa","firstname":"bbb","lastname":"ccc"}, {"name":"qqq","firstname":"eee","lastname":"mmm"}, {"name":"www","firstname":"ooo","lastname":"lll"}] I am making ajax request to server, its returning the above json data.But i >am getting the json parse error $(document).ready(function() { $('#example').dataTable( { "processing": true, "serverSide": true, "ajax": { "url": "http://example", "dataType": "jsonp", "columns": [ { "data": "name"}, { "data": "firstname" }, { "data": "lastname" }

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 stop YADCF Filters in Datatables to mess with the headers cell width

好久不见. 提交于 2019-12-24 05:23:10
问题 When I add some YADCF filter to the datatable the resizing of the columns get messed up (as seen in te pictures). Is it possible to prevent this? No Filters With Filters --------------- EDIT ----------------- As sugested by Daniel, here's the result: nowrap As you can see, it's not good yet... Why does the yadcf filters increase the size of the TH ? 回答1: It's not yacdf which resizes the column, sizing is a complex thing. yacdf just places a text input element, which inherits certain width

How to load table in Datatables and have it scroll to last record automatically on load

ぃ、小莉子 提交于 2019-12-23 16:16:02
问题 Problem : using dataTables javascript library to display data perfectly fine. Data is retrieved via PHP/mysql and then the table is drawn and the code cycles through the tables as such : JAVA code for dataTables - <script> $(document).ready(function() { $("#PayMasterResults").dataTable( { "sPaginationType": "full_numbers", "bPaginate": false, "bJQueryUI" : true, "sScrollY": "215", "bLengthChange": true, "bFilter": true, "bSort": false, "bInfo": true, "bAutoWidth": false, "sDom": \'<"H"lTfr>t<