datatables-1.10

DataTables Pager Showing Many Pages when there is Only One

落花浮王杯 提交于 2020-04-17 19:00:18
问题 This is a weird one. I'm using datatables v1.10.19 with jQuery 3.3.1 and Bootstrap 3.3.7 My datatables grid is configured to display 1000 records (but you can change it to 2500, 5000 and "all"). I've only got about 60 records in my database. It is using Server-Side processing to retrieve data. When the grid loads, the pager displays 5 buttons plus an ellipses (as if there is even more). And even weirder, if I change the drop-down to display "all" records, it acts as I would expect i.e. the

Unable to make service call in Data tables server side processing

吃可爱长大的小学妹 提交于 2020-03-05 03:11:09
问题 Javascript $('#grid').DataTable({ "processing": true, "destroy": true, "scrollY": true, "scrollX": true, "serverSide": true, "paging": true, "pageLength": 20, "lengthChange": false, "language": { search: '', searchPlaceholder: "Search..." }, "ajax": { "url":'api/Default/EmployeeDetails', "contentType": "application/json", "type": 'POST', "dataType": "json", "data": function (d) { debugger; return JSON.stringify(d); }, "dataSrc": function (json) { debugger; //json.draw = json.draw; //json

Expanding and collapsing child rows in Shiny DataTable

社会主义新天地 提交于 2020-02-20 09:13:03
问题 I'm having trouble replicating a datatable object in Shiny. Currently, I can display what I want when I run the data table portion of the code outside of a Shiny environment. However, when I run the entire code, it's not displaying the child table. library(DT) library(data.table) library(shiny) shinyApp( ui = fluidPage(DT::dataTableOutput('tbl')), server = function(input, output) { output$tbl = DT::renderDataTable( datatable({ #Transform dataframe to data.table and turn the dataframe rowname

Expanding and collapsing child rows in Shiny DataTable

放肆的年华 提交于 2020-02-20 09:12:46
问题 I'm having trouble replicating a datatable object in Shiny. Currently, I can display what I want when I run the data table portion of the code outside of a Shiny environment. However, when I run the entire code, it's not displaying the child table. library(DT) library(data.table) library(shiny) shinyApp( ui = fluidPage(DT::dataTableOutput('tbl')), server = function(input, output) { output$tbl = DT::renderDataTable( datatable({ #Transform dataframe to data.table and turn the dataframe rowname

Total of a column in DT dataTables in shiny

不问归期 提交于 2020-01-10 04:10:39
问题 I am trying to calculate the total of a column in my shiny app using DT::datatable. By total I mean the sum of all elements in a table not just what is showing in the current pagination. Following this example the following code should work (but it doesn't): jsCode <- "function(row, data, start, end, display) { var api = this.api(), data; total = api.column(1, {page: 'all'}).data().reduce( function(a, b) { return a + b}, 0); $( api.column(1).footer() ).html('Total: ' + total); }" All I am

Total of a column in DT dataTables in shiny

做~自己de王妃 提交于 2020-01-10 04:10:05
问题 I am trying to calculate the total of a column in my shiny app using DT::datatable. By total I mean the sum of all elements in a table not just what is showing in the current pagination. Following this example the following code should work (but it doesn't): jsCode <- "function(row, data, start, end, display) { var api = this.api(), data; total = api.column(1, {page: 'all'}).data().reduce( function(a, b) { return a + b}, 0); $( api.column(1).footer() ).html('Total: ' + total); }" All I am

filter table data based on drop down values of first column only in DataTables

眉间皱痕 提交于 2020-01-05 13:36:45
问题 The functionality for select options for all the columns as mentioned on the website of data tables is mentioned below. How do i make it filter the table data on the drop down values of the first column only and also place the select drop down somewhere else rather than the usual header section.see link for example initComplete: function () { var api = this.api(); api.column().indexes().flatten().each( function (i) { var column = api.column(i); var select = $('<select><option value=""><

filter table data based on drop down values of first column only in DataTables

ⅰ亾dé卋堺 提交于 2020-01-05 13:35:02
问题 The functionality for select options for all the columns as mentioned on the website of data tables is mentioned below. How do i make it filter the table data on the drop down values of the first column only and also place the select drop down somewhere else rather than the usual header section.see link for example initComplete: function () { var api = this.api(); api.column().indexes().flatten().each( function (i) { var column = api.column(i); var select = $('<select><option value=""><

Retrieve dataTable object of element

夙愿已清 提交于 2020-01-05 05:36:12
问题 I am trying to get an object of a jQuery Data Table using JQuery. I am using this thread to accomplish this: https://datatables.net/forums/discussion/2913/how-to-get-the-otable-datatable-object-from-the-tables-id For some reason this does not work. When I call $('.dynamic-wide-table').dataTable(); it causes my table to initialize AGAIN and make the table render twice, like so: According to the link posted above it should NOT be doing that, but instead just fetch the object. Here is my code:

Sorting is not working in jQuery datatables

爷,独闯天下 提交于 2020-01-04 06:35:12
问题 I have two inline tables in one page, sorting is working on one data table but not on other, calling both div's at a time, but sorting is working on only one data table. $('#div1').DataTable( { "processing" : true, "destroy" : true, "paginate" : true, "lengthChange" : true, "filter" : true, "ordering" : true, "order" : [ [ 1, "asc" ] ], "info" : false, "reloadDT" : false, "autoWidth" : false, "scrollY" : 340, "language" : { "search" : "Search: ", "processing" : "<span class='loadingImg'><