datatables-1.10

Expand Child Rows of Responsive Datatables automatically

流过昼夜 提交于 2019-12-05 05:42:51
问题 I have a responsive dataTable (Responsive doc.) in the following format: var dataTableInfo = j$('[id$="dataTableInfo"]').DataTable({ responsive: { "autoWidth": true, details: { type: 'column', target: 0 } }, columnDefs: [ { className: 'control', orderable: false, targets: 0 } ] }); I fill this with data through a search to an external data source and I then have a second table inside the DataTable with additional data (in a child Row) that comes automatically from my instaniation. I can click

Upgrade to jquery-datatables-rails 2.2.3 from 2.2.1 breaks code in RailsCasts 340 Datatables

坚强是说给别人听的谎言 提交于 2019-12-05 05:39:21
问题 This is informational, in that I am posing the question and will provide the answer. It's for the record and to help anyone that follows me here. I build DataTables using RailsCasts 340. They worked great, but I had some struggles with it with column width versus table width and such. See Datatable rows extend past table boundary, or are too narrow. In general, it seemed to be a good idea to upgrade jquery-datatables-rails from 2.2.1 to 2.2.3 to get from DataTables 1.9 to 1.10. This also

dataTables export button display in custom position?

谁都会走 提交于 2019-12-05 01:43:02
问题 I want to show my dataTable export button in custom div . how can I Do this ? my Current code this is default code and buttons show seperatly on top of my table. how can I edit this? $(document).ready(function() { $('#example').DataTable( { dom: 'Bfrtip', buttons: [ 'excelHtml5', 'csvHtml5', ] } ); } ); where I want to display <select id="ex"> <option>Export </option> <option id="csv" >CSV</option> <option id="xls" >XLS</option> </select> here is the fiddle https://jsfiddle.net/qt9p2fwt/3/

Populating Datatables with JSON array from GET request

匆匆过客 提交于 2019-12-04 04:44:38
I know that there has been many answers and tutorials about populating Jquery Datatables with data but I always get to the point of getting the following exception: Uncaught TypeError: Cannot read property 'length' of undefined I, being mainly a backend developer, have little to no experience with writing client so I would like to ask you about what I am doing wrong in the following example. I have a server running locally exposing an endpoint /destination which responds with a JSON string in this format: [{ "id": 1, "name": "London Heathrow", "lat": 51.470022, "lon": -0.454295 }, { "id": 2,

How to modify row counts when displaying alphabetized search results

半城伤御伤魂 提交于 2019-12-04 02:55:06
I am using DataTables to create a table that is able to dynamically filter context. I am following the basic example, here . However, I want to make one customisation: To display alphabetised results in my table, with a "title row" for each alphabet letter. Eg: A - Apple - Avocado B - Bear - Button C - Car I have done this successfully (using Django templating on the server side for the output), but the footer label Datatables shows by default is now incorrect, because it counts the title rows. In the above example it reads: Showing 1 to 8 of 8 entries When it should read: Showing 1 to 5 of 5

Upgrade to jquery-datatables-rails 2.2.3 from 2.2.1 breaks code in RailsCasts 340 Datatables

a 夏天 提交于 2019-12-03 21:19:17
This is informational, in that I am posing the question and will provide the answer. It's for the record and to help anyone that follows me here. I build DataTables using RailsCasts 340. They worked great, but I had some struggles with it with column width versus table width and such. See Datatable rows extend past table boundary, or are too narrow . In general, it seemed to be a good idea to upgrade jquery-datatables-rails from 2.2.1 to 2.2.3 to get from DataTables 1.9 to 1.10. This also includes datatables-responsive 0.2.0. Referring to Converting parameter names for DataTables 1.10 , you'll

dataTables export button display in custom position?

倖福魔咒の 提交于 2019-12-03 16:22:57
I want to show my dataTable export button in custom div . how can I Do this ? my Current code this is default code and buttons show seperatly on top of my table. how can I edit this? $(document).ready(function() { $('#example').DataTable( { dom: 'Bfrtip', buttons: [ 'excelHtml5', 'csvHtml5', ] } ); } ); where I want to display <select id="ex"> <option>Export </option> <option id="csv" >CSV</option> <option id="xls" >XLS</option> </select> here is the fiddle https://jsfiddle.net/qt9p2fwt/3/ It is quite a headache to clone the button events and destroy the elements. Why not just hide the buttons

Datatable styling so bootstrap button appears on same row as other elements

让人想犯罪 __ 提交于 2019-12-03 01:12:15
问题 I'm using jQuery DataTables plugin and Bootstrap on my rails site. I can't get my custom button and other table header elements to nest in the same row, They are stacked instead of being inline. Any suggestions to get them all on the same line? Here is some of the JavaScript I've used: $(document).ready(function() { $('#products').DataTable( { dom: 'Blfrtip', buttons: [ { text: 'Pull my products', action: function ( e, dt, node, config ) { alert( 'Button activated' ); } }] }); }); 回答1:

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

十年热恋 提交于 2019-12-03 00:31:44
问题 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": {

Disable initial automatic ajax call - DataTable server side paging

会有一股神秘感。 提交于 2019-12-02 20:17:22
I have a dataTable initialized with server side paging and it is working fine. This table triggers ajax, pulls data and renders onto the table during initialization. However I need empty table initially and load table data on click of a button using load() or reload() like: myTable.api().ajax.reload(); Here is my table initialization: function initTestTable(){ myTable = $('#testTable').dataTable({ "processing": true, "serverSide": true, "ajax": { "url": "testTableData.html", "type": "GET", }, "columns": [ { "data": "code" }, { "data": "description" } ] }); } There should be a way to restrict