jquery-datatables

Datatable rows extend past table boundary, or are too narrow

血红的双手。 提交于 2020-01-15 11:23:56
问题 Ruby 2.0.0, Rails 4.0.3, jquery-datatables-rails 2.2.3 (w/DataTables 1.10.1), jquery-rails 3.1.1, jquery-ui-rails 5.0.0, lodash-rails 2.4.1, bootstrap-sass 3.2.0.1 I am having trouble getting Datatables to format correctly. Either the columns overrun the form, or the columns are too narrow. I've tried a myriead of fixes for this. I have set columnDefs and column width. I've set HTML width in the table headings. I've set autoWidth false and true. I've set the CSS width dynamically. I've

Datatable rows extend past table boundary, or are too narrow

不想你离开。 提交于 2020-01-15 11:23:46
问题 Ruby 2.0.0, Rails 4.0.3, jquery-datatables-rails 2.2.3 (w/DataTables 1.10.1), jquery-rails 3.1.1, jquery-ui-rails 5.0.0, lodash-rails 2.4.1, bootstrap-sass 3.2.0.1 I am having trouble getting Datatables to format correctly. Either the columns overrun the form, or the columns are too narrow. I've tried a myriead of fixes for this. I have set columnDefs and column width. I've set HTML width in the table headings. I've set autoWidth false and true. I've set the CSS width dynamically. I've

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:

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

DataTable : How to hide table header?

好久不见. 提交于 2020-01-14 08:14:03
问题 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

What's the correct AJAX pattern for using the jQuery DataTable with ASP.NET MVC?

一世执手 提交于 2020-01-14 04:17:14
问题 I have a jQuery DataTable configured for server-side processing against an ASP.NET MVC server. To achieve progressive enhancement, an HTML table is rendered, and then upgraded to a DataTable. When the DataTable makes an AJAX call to retrieve more data, it expects elements of the returned JSON to correlate with the existing table-column layout. This seems to cause some architectural friction, because: During initial page rendering: The Controller transforms database data into DTOs and

render jquery datatable boolean column with check and x

梦想与她 提交于 2020-01-12 14:32:07
问题 How do you render a boolean true/false value coming from JSON to a green check or a red x on a jquery datatable? For example, something like: &check; &check; and &cross; &cross; 回答1: Using bootstrap glyphicons you can do this: personTable = $("#person-table").DataTable({ order: [1, "desc"], "autoWidth": false, ajax: { url: uri, dataSrc: "", }, "columns": [ { "data": "FirstName", "title": "Name" }, { "data": "Address", "title": "Address" }, { "data": "IsActive", "title": "Active" } ],

render jquery datatable boolean column with check and x

廉价感情. 提交于 2020-01-12 14:31:48
问题 How do you render a boolean true/false value coming from JSON to a green check or a red x on a jquery datatable? For example, something like: &check; &check; and &cross; &cross; 回答1: Using bootstrap glyphicons you can do this: personTable = $("#person-table").DataTable({ order: [1, "desc"], "autoWidth": false, ajax: { url: uri, dataSrc: "", }, "columns": [ { "data": "FirstName", "title": "Name" }, { "data": "Address", "title": "Address" }, { "data": "IsActive", "title": "Active" } ],

Datatables sDom challenge add new element to bottom left of table

不打扰是莪最后的温柔 提交于 2020-01-12 07:58:19
问题 I want to add a "refresh" button to my tables at the bottom of the table. But I just started using datatables and its a bit confusing as is the "sDom" part where it says I can do this through that means but the description is vague at best. "sDom": '<"top"i>rt<"bottom"flp><"clear">' is the datatables.net example, but I dunno how to make heads or tails of that and all I want to do is one simple thing. Or is there an outside of "sDom" that would be better suited for what I want to do? 回答1: Here

Uncaught TypeError: Cannot read property 'aDataSort' of undefined

ε祈祈猫儿з 提交于 2020-01-10 02:56:25
问题 i am working on pagination and i am using DataTables plugin , on some tables it's work but on some tables it gives error: Uncaught TypeError: Cannot read property 'aDataSort' of undefined my page script looks like: $(document).ready(function() { $('.datatable').dataTable( { "scrollY": "200px", "scrollCollapse": true, "info": true, "paging": true } ); } ); //HTML code <table class="table table-striped table-bordered datatable"> <thead> <tr> <th><?php echo lang('date_label')?></th> <th><?php