jquery-datatables

Create a new regular table from visible and filtered rows of DataTable

。_饼干妹妹 提交于 2019-12-11 04:04:43
问题 I have a DataTable with paging, filtering and ColVis plugin (column visibility). By pressing a button, I need to get the visible and filtered data of all pages , and generate a new regular table below with this data (this one without datatables, pager, ...). I tried with oTable.rows({search:'applied'}).data() to get the rows, but instead of getting only the data of the visible columns, it gets the hidden ones as well. And anyway I don't know how to generate the new table. Here's a demo How

jQuery DataTables filter multiple words and return all rows that match at least one of them

大憨熊 提交于 2019-12-11 03:38:59
问题 Lets say I have two rows in the table all with a single column: hello mr red goodbye morpheous I want to be able to filter for "hello morpheous" and have it return both rows. By default it does not do this? It will only return the row containing "hello". Can can I achieve this? Thanks :) 回答1: You simply create a custom filter like this : $.fn.dataTableExt.afnFiltering.push( function(oSettings, aData, iDataIndex) { var filter = $("#example_filter input").val(); filter = filter.split(' '); for

dynamically set table titles with jquery's Datatables plugin - get titles from data object

半腔热情 提交于 2019-12-11 03:35:48
问题 Im searching for a way to set tables titles dynamically. there's a search form that performs database queries, and gets a different data-set each time, according to user choice. right now titles are hard-coded in the html. this is how I set up the table: <table id="searchResults" class="display table table-striped table-bordered" cellspacing="0" width="100%"> <thead> <tr> <th>agentId</th> <th>confirmTime</th> <th>name</th> <th>amount</th> <th>currency</th> <th>amountUSD</th> </tr> </thead>

Getting value from a dynamically-generated DataTable input

左心房为你撑大大i 提交于 2019-12-11 03:32:21
问题 So, I have a dataTable that gets its data from ajax. I want two of the columns to have text inputs so that the user may edit and update the information by clicking a button in the same row. This works fine like this: { "render": function ( data, type, row ) { return '<input id="nameInput" type="text" value="' + row.name + '" />'; }, "targets": 0 }, { "render": function ( data, type, row ) { return '<input id="hourlyRateInput" type="text" value="' + row.hourlyRate + '" />'; }, "targets": 1 },

jQuery datatables - difference between fnGetNodes() and fnGetData()?

半腔热情 提交于 2019-12-11 03:16:00
问题 I was wondering what the difference is between these two calls? fnGetNodes() returns all rows and so does fnGetData(). What is the difference then? 回答1: fnGetNodes() returns a list of tr elements that have been generated. If you are using deferRender: true fnGetNodes() will only return rows from pages that have been visited. fnGetData() on the other hand returns the array of objects aoData that contains all rows of data (but not the tr elements). 回答2: Interesting. This is what we should do to

JS regex matching whole words with hyphen In dataTables

徘徊边缘 提交于 2019-12-11 02:13:08
问题 Not sure if this is best posted here or on the JQ dataTables forum. I'll try here. Doing exact regex matching on columns in a dataTable and have two cases one works great but the second not so good! CASE 1 Column data Joe Bob Sue Bobby Joey So then I want all the rows that have Joe, Bob, Sue and not Bobby and Joey. MY regex looks like this; \b(Joe|Bob|Sue)\b And it works great. I see filtered rows for the three names and not Bobby and Joey. I use the pipe separated list because I also store

Get variables in datables passed by django

馋奶兔 提交于 2019-12-11 02:01:41
问题 I am using jquery datatables in my django app. every row in my table have a named url to another page together with the object. {% url 'obj_details' obj.id %} . When I click on the url I am getting no reverse match found error. I have inspected the issue in detail. The url obj_details is a named url that exists in the urls.py url(r'^obj/(?P<pk>[\w-]+)/details$', objDetailsView.as_view(), name='obj_details') datatables uses another view to get the required data it is as pasted below def

Prevent multiple radio button selections in paginated jquery Datatables

删除回忆录丶 提交于 2019-12-11 01:54:12
问题 I am using Jquery datatables with pagination in Html. The radio button working fine in single page, but it is unable to prevent the multiple selections of radio button when it somes to multiple pages, i.e if i select one radio button in page 1 and another radio button in Page 2, then both are being in selected mode only. Radio button is known for single selection, but here I am getting different behaviour 回答1: I had same problem like you. I found one solution for this problem. please find the

Giving right align to numeric data in datatables

你。 提交于 2019-12-10 23:28:35
问题 I am using jquery-datatables. I want that if the value is numeric its alignment should be right and if it is string then the alignment should be left. Is it possible with datatables or is there any method in it? <% @tasks.each do |task| -%> <tr> <% col_order.each do |key| %> <td> <% value = task[key.column_name.split(" as ")[1]] || task[key.column_name.split(".")[1]] -%> <% if key["drilldown_reportid"].present? %> <%= link_to value, project_report_path(@current_project,key["drilldown_reportid

AngularJS - Jquery datatable empty

和自甴很熟 提交于 2019-12-10 22:07:14
问题 I'm trying to display a datatable using angular and jquery datatable but so far the datatable stays empty after applying the datatable function. I've read that the best way is to use a directive but I can't get it working. This only I've manage to get it working is by applying a timeout with 100 ms (time out less than 100 didn't work) What I'd like to do is to apply the datatable function after the DOM is rendered. I'm sure someone has managed to do that ;) userController.js myApp.controller(