datatables

Solution for Ellipsis - Jquery + Bootstrap + Datatables

社会主义新天地 提交于 2020-01-15 09:43:29
问题 I am using Datatables on a site with bootstrap and jquery for a large (2000+ entries) table. Some of the (text) values are way too long and at the moment I use something like this: render: function ( data, type, row ) { return data.length > 35 ? data.substr( 0, 35 ) +'…' : data; } in Datatables to cut the strings and display the full value in the html title. Is there a better way to do this? Like a plugin that automatically cuts but shows all when clicked on or something similar? I was not

Solution for Ellipsis - Jquery + Bootstrap + Datatables

Deadly 提交于 2020-01-15 09:43:07
问题 I am using Datatables on a site with bootstrap and jquery for a large (2000+ entries) table. Some of the (text) values are way too long and at the moment I use something like this: render: function ( data, type, row ) { return data.length > 35 ? data.substr( 0, 35 ) +'…' : data; } in Datatables to cut the strings and display the full value in the html title. Is there a better way to do this? Like a plugin that automatically cuts but shows all when clicked on or something similar? I was not

Datatables not refreshing after second network request

二次信任 提交于 2020-01-15 09:13:09
问题 I've defined my datatable like so: $('div#accessorial-list-table table').dataTable({ 'bProcessing': true, 'bServerSide': true, 'bSort': true, 'sAjaxSource': '/accessorials/fetch', 'sPaginationType': 'full_numbers', "sDom": '<"top"<"clear">>r', 'aaSorting': [[ 0, 'asc' ]], 'iDisplayLength': 1000, 'oLanguage': { 'sInfoFiltered': '', 'sProcessing': 'DOING THINGS', 'sLengthMenu': '', 'oPaginate': { 'sPrevious': '', 'sNext': '', 'sFirst': '', 'sLast': '' } }, "aoColumns": [ null, null, null, {

Datatables not refreshing after second network request

牧云@^-^@ 提交于 2020-01-15 09:13:08
问题 I've defined my datatable like so: $('div#accessorial-list-table table').dataTable({ 'bProcessing': true, 'bServerSide': true, 'bSort': true, 'sAjaxSource': '/accessorials/fetch', 'sPaginationType': 'full_numbers', "sDom": '<"top"<"clear">>r', 'aaSorting': [[ 0, 'asc' ]], 'iDisplayLength': 1000, 'oLanguage': { 'sInfoFiltered': '', 'sProcessing': 'DOING THINGS', 'sLengthMenu': '', 'oPaginate': { 'sPrevious': '', 'sNext': '', 'sFirst': '', 'sLast': '' } }, "aoColumns": [ null, null, null, {

DataTables TypeError: …draw is not a function

瘦欲@ 提交于 2020-01-15 05:23:30
问题 I'm attempting to use a custom input for searching/filtering a jQuery Datatables table. I'm using jQUery 2.1.1 and DataTables 1.10.4. My code is pretty simple, and mirrors what's in the API docs: var table = $('#pList').DataTable({ "pageLength": 25, "lengthChange": false, "ajax": 'partsJSON.cfm' }); $('#pdb-filter').on( 'keyup', function () { console.log(table); table.search( this.value ).draw(); } ); When I run the page and make entries in the input, I get the following in the console:

How can I prevent duplicate wrappers on a jQuery DataTable when navigating back in the presence of Turbolinks?

烂漫一生 提交于 2020-01-14 14:51:44
问题 I'm using jQuery DataTables in a new Rails 4.2 project. I've got a large number of results that need to be filtered on group, project, and status. Choosing the group filters the project selection, via a roundtrip through the application, and the project selection filters the table the same way. I save the group & project in session variables so that, when the user changes pages, then clicks the main link to come back, it will remember their selection, and get them back to where they were.

How can I prevent duplicate wrappers on a jQuery DataTable when navigating back in the presence of Turbolinks?

谁都会走 提交于 2020-01-14 14:51:09
问题 I'm using jQuery DataTables in a new Rails 4.2 project. I've got a large number of results that need to be filtered on group, project, and status. Choosing the group filters the project selection, via a roundtrip through the application, and the project selection filters the table the same way. I save the group & project in session variables so that, when the user changes pages, then clicks the main link to come back, it will remember their selection, and get them back to where they were.

how to show and hide columns of using datatable jquery

有些话、适合烂在心里 提交于 2020-01-14 14:17:54
问题 I need to show and hide the columns of the datatable after doing a javascript test, but it doesn't work good. This is my test javascript: if ( $('#commune_to_display').val()==""){ $('#utable td:nth-child(2)').hide(); $('#commune_to ').hide(); } This test works just in the first page of the datatable, after pagination the column is still visible. How can I fix it? thanks for help 回答1: You can show/hide columns as shown below. Just replace 3 and 4 with your actual column indexes. var table = $(

R DT datatable not retaining row index/counter column after selecting new page when using callback option

只愿长相守 提交于 2020-01-14 13:34:29
问题 I am using this question as a reference to add a "row index" or "counter column" (as described in the datatable documentation here) to a DT::datatable in a Shiny application. The intent is to hold the row names in the table constant (1, 2, 3...) regardless of the sorting that is applied to the table. The user NicE answered this question by converting the javascript code in the datatable documentation for use in the callback of the DT::datatable options: output$tbl = renderDataTable({

DataTable : How to hide table header?

允我心安 提交于 2020-01-14 08:14:17
问题 I have 2 tables using DataTable : top: exact match bottom : related Here is what they look like right now. As you can see that, there is no need to show the table header on the second table. I want to hide it. I have tried using this on my CSS : Since the class = inventory_related .inventory_related table thead { display:none; } I also tried to take off the whole : <thead class="thin-border-bottom "> <th>Catalog # </th> <th>Description</th> <th>Available Vials</th> </thead> This doesn't work