datatables

Replacing initial Dataframe from an editable DataTable and using that new data frame in another table

你。 提交于 2021-01-29 12:32:15
问题 I have a nested DataTable in my Shiny app. Some of the columns in the child table are editable by the user. The goal here is to have the user edit the values and then the data frame would be replaced with those new values. Then I would like to take that replaced data frame and use it for another table. I need to use the edited values for calculations in the other table. workflow : create nested data table -> user edits values -> initial data is replaced by new data -> use the new data for

Query datatable from rest api without pre-defining the table in html

情到浓时终转凉″ 提交于 2021-01-29 10:23:56
问题 I would like to query a JSON via post request from a rest API: http://localhost/post1 param1='1' that returns the following: { "json_table": [ { "date": 123, "test": "hello2" }, { "date": 19, "test": "hello" }, } and it should then be automatcially populated into a jquery datatable, a little bit how it is described here: $('#myTable').DataTable( { ajax: '/api/myData' } ); What I don't understand is: How can I tell it to make a post request with a parameter How can I create the table without

Toggle hide/show child rows in datatable (without shiny)

和自甴很熟 提交于 2021-01-29 10:15:53
问题 I want to create a datatable from this dataframe: df1 <- data.frame( brand = c("Brand 1", "Subbrand 1.1", "Subbrand 1.2", "Brand 2", "Subbrand 2.1", "Subbrand 2.2"), sales = 100 * 1:6 ) The brands should be parent rows and the subbrands child rows which should be hidden in the beginning. On click on a parent rows its subbrands should be shown. This must work without shiny as I want to integrate it into a HTML-flexdashboard. I think to solve this I will need a callback like in this example but

Not getting response while ajax call in jQuery Data table

半世苍凉 提交于 2021-01-29 09:48:32
问题 I tried ajax call in separate page it's working fine but through jQuery data table I'm not getting response. API is in AWS. I tried though API end point with key. Problem is while trying ajax request in jQuery data table the request payload not send properly it shows an encryption data and also not return any response. Sample code as given below: var dataListNew = { "fromDate": "2021-01-01", "toDate": "2021-01-14"}; $('#co-table').DataTable({ //"scrollY": "400px", dom: 'Bfrtip', buttons: [ {

Matching Parent/Child data up in a DataTable in R Shiny app

戏子无情 提交于 2021-01-29 09:22:31
问题 I have two dataframes; markets is the parent row and mix_breakout is the child table. Each parent row has their own unique child table. I am trying to only have the mix_breakout data that is unique to the parent markets show up in the nested table. For example, the parent row that has the market ABILENE-SWEETWATER should only show data from the same market in mix_breakout . There also can be an arbitrary number of market / mix_breakout here. This example shows 2 combos, but there can be up to

Datatables and Moment.js for D-MMM-YY sorting

蓝咒 提交于 2021-01-29 08:31:52
问题 I'm trying to get my datatables with dates entered in the D-MMM-YY format to be sorted but it doesn't appear to do so, only by the 1st digit in the date. For example, it sorts 9-Sep-13 before 1-Jun-20. A typical table line is as follows: <tr> <td>25-Jul-11</td> <td>Announcement</td> <td><a href="#">#</a></td> </tr> My javascript is as follows: <script type="text/javascript"> $(document).ready(function() { $.fn.dataTable.moment( 'D-MMM-YY'); $('#pn2020').DataTable({ "pageLength": 20, order: [[

How do I sort by a hidden column in DataTables?

拈花ヽ惹草 提交于 2021-01-29 07:20:56
问题 When I apply DataTables to the following: <td class="years"><?php $years."-years" ?></td> <td class="..." ... ... other <td> ... my table displays as follows: 10-years ... ... ... 10-years ... ... ... 5-years ... ... ... 7-years ... ... ... 9-years ... ... ... because of the alphabetic ordering. I need 10-years to appear at the bottom. To do that I added <td class="hidden"><?php $years ?></td> right after <td class="years"><?php $years."-years" ?></td> and added "order": [ 1, 'asc' ] to the

DataTables.js pagination and search not working

*爱你&永不变心* 提交于 2021-01-29 07:15:45
问题 I'm loading all my rows into DataTables via ajax. The rows are successfully loading, but nothing is paginated (however the pagination buttons are being successfully counted when the "Show 25 entries" dropdown is changed). Additionally, search is not working. No errors are being output to the console whatsoever. Here is some sample data, my DataTables JS call, and markup for the actual table. Sample JSON Data { "draw": 0, "recordsFiltered": 100, "recordsTotal": 100, "data": [ { "version": "1.0

How to remove dropdown select options from pdf in datatable

為{幸葍}努か 提交于 2021-01-29 06:42:05
问题 I have included dropdown to each column at footer, while generating pdf,all options are coming into header.how can we exclude these option while export? Here is my code: $('#example').DataTable( { "dom": 'Bfirtlp', buttons: [ { extend: 'excelHtml5', exportOptions: { columns: ':visible' } }, { extend: 'pdfHtml5', orientation: 'landscape', pageSize: 'A3', exportOptions: { columns: [ 0, 1, 2,3,4,5,6,7,8], }, ], initComplete: function () { this.api().columns().every( function () { var column =

datatable row reorder completion, not getting updated row id

我与影子孤独终老i 提交于 2021-01-29 05:36:36
问题 I am working on datatable. I have used reorder functionality, it works, but I am not getting its updated reorder row id, it always fetching old row id. Here I have put my code for it. Can anyone please check my code and help me to resolve this issue? table_all_projects.on('row-reorder.dt', function(dragEvent, data, nodes) { //console.log("all nodes"); var n = 0; table_all_projects.rows({ order: 'current' }).every(function(rowIdx, tableLoop, rowLoop) { console.log(this.data().id); console.log