datatables-1.10

Angular 2 with JQuery DataTable Ajax Call

纵然是瞬间 提交于 2019-12-11 06:25:54
问题 I want to call an API from my Angular 2 application with Jquery DataTable Ajax call. Request was successful but the parameters for the request been converted to Query String Parameters when i looked into Google Chrome Network tab it is like =%7B&1=%22&2=T&3=a&4=b&5=l&6=e&7=S&8=c&9=h&10=e&11=m&12=a&13=%22&14=%3A&15=%22&16=T&17=1&18=%22&19=%7D&_=1487761201305 And when i call API from Angular 2 Http.post and looked into Google Chrome Network tab the request contains Request Payload its like

DataTables - dynamically set columns searchable

守給你的承諾、 提交于 2019-12-11 04:13:51
问题 I need to set the searchable property of a column dynamicaly (after table init). Is there a solution? The use-case is, that I'm using the button extension to toggle column-visibility. But I wan't that only visibile columns are searched. 回答1: I wanted to add "filter buttons" to the table. They should search(filter) just in one excluded & hidden & not-searchable column. excluded & hidden because the user should not be able to see it not searchable because I wanted to exclude it from the global

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

Datatables - Server-side processing - DB column merging

南楼画角 提交于 2019-12-11 02:17:34
问题 I'm currently using DataTables 1.10.5 server-side processing feature: http://www.datatables.net/examples/data_sources/server_side.html Haven't done any major modifications yet, just inserted the column names, etc. $columns = array( array( 'db' => 'clinicaId', 'dt' => 0 ), array( 'db' => 'rotaId', 'dt' => 1 ), array( 'db' => 'delegadoId', 'dt' => 2, 'formatter' => function( $d, $row ) { $delegado = new Delegado($d); return $delegado->display('name'); } )); So, in my sql table, I have 2 columns

Get 'data-sort' orthogonal value from DataTables within search.push function

和自甴很熟 提交于 2019-12-10 23:36:23
问题 I am looping the rows within $.fn.dataTable.ext.search.push function to select some rows based on many criteria. I am setting some values on the TD of the tables known as orthogonal data. I am trying to get the value of the 'data-sort' but I don't know how. I am able to get the cell's inner data via data[2] (for column 2), but not the 'data-sort' or 'data-filter'. Any ideas? $.fn.dataTable.ext.search.push( function (settings, data, dataIndex) { var iRating = parseFloat(data[2]) || 0; // this

Summing a filtered column in DataTables

痴心易碎 提交于 2019-12-10 18:43:25
问题 I'm trying to sum the results of filtered columns in DataTables. I've viewed the questions asked on their website and folks have had success using this method. However, similar code for me produces 'Uncaught TypeError: undefined is not a function." data = table._('td:nth-child(10)', {"filter": "applied"}); where 'table' is: var table = $('#dataTable').DataTable({ // my initialization data }); 回答1: _ (the underscore function) seems to be deprecated in dataTables 1.10.x. In theory it should

DataTable with JSON data

痞子三分冷 提交于 2019-12-10 18:23:24
问题 I am trying to create a table using DataTable but having a hard time getting DataTable to load with JSON object. function getData() { var request = new XMLHttpRequest(); var json = "link-to-my-json-object"; // Get JSON file request.onload = function() { if ( request.readyState === 4 && request.status === 200 ) { var JSONObject = JSON.parse(request.responseText); createTable(JSONObject); } else if(request.status == 400) { console.log("Error", request.status);} }; request.open("GET", json, true

Datatables.net ajax reload loading message

て烟熏妆下的殇ゞ 提交于 2019-12-10 18:04:01
问题 On initial load of my datatable via ajax, the table shows no data and 'Loading...' appears in the table body. On DataTable().ajax.reload(), the 'Loading...' text is not present. I know I can turn on the processing option to get the bar across the table, but if I do this then on initial loading my users see both 'Loading...' in the table body and 'Processing...' on top of that. Has anyone found a solution to have one all the time or the other? I would prefer to replace the table body with

How to disable DataTables paging after initialization?

被刻印的时光 ゝ 提交于 2019-12-10 17:54:33
问题 I have a DataTable with pagination enabled and I need to disable this setting and show all the results without pager by pressing a button. I'm trying to access the already defined settings, change the paging to false, and redraw the table, but it doesn't work. I searched and tried similar forum threads without success. Any idea how can I achieve that? Here's a demo with my not-working code HTML: <div id="main_wrapper"> <button class="form_button destroy_pager" type="button" onclick="" title=

Why does dataTable doesnt show empty data message?

北城余情 提交于 2019-12-10 12:26:37
问题 This is how i return my dataset when no results found for particular search in dataTable serverside processing data :null recordsFiltered:"0" recordsTotal:"0" but frondend doesnt show any no result found message .its stuck with processing. and console give an error Uncaught TypeError: Cannot read property 'length' of null maybe this is null means my data=null. how can I show datatable default message saying no search results. ? i'm using datatable version 1.10.13 with serverside processing ,