datatables

Datatable: date / time sorting plug-in not ordering

跟風遠走 提交于 2021-02-08 13:11:06
问题 I have a basic SpringBoot app., embedded Tomcat, Thymeleaf template engine I want to order 1 date column of a datatable. in my POJO: public String getTimeFormatted() { DateTimeFormatter formatter = DateTimeFormatter.ofPattern("EEEE, MMMM d,yyyy h:mm,a", Locale.ENGLISH); LocalDateTime dateTime = LocalDateTime.ofEpochSecond(time, 0, ZoneOffset.UTC); return dateTime.format(formatter); } in the template: <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.4/moment.min.js"></script>

Datatable: date / time sorting plug-in not ordering

喜你入骨 提交于 2021-02-08 13:10:51
问题 I have a basic SpringBoot app., embedded Tomcat, Thymeleaf template engine I want to order 1 date column of a datatable. in my POJO: public String getTimeFormatted() { DateTimeFormatter formatter = DateTimeFormatter.ofPattern("EEEE, MMMM d,yyyy h:mm,a", Locale.ENGLISH); LocalDateTime dateTime = LocalDateTime.ofEpochSecond(time, 0, ZoneOffset.UTC); return dateTime.format(formatter); } in the template: <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.4/moment.min.js"></script>

Why date is not sorting perfectly in Datatables?

六月ゝ 毕业季﹏ 提交于 2021-02-08 11:15:50
问题 I have try many ways to sort date in dataTables but not working perfectly (asc or desc). I referred to any place to find the solution but not solve. Below are the method that I have tried but not working. Use Date Eu plugin. Here 1 , Here 2 , Here 3 JS function loadtable(){ var project = ''; $.ajax({ url : url, crossDomain: true, type : 'POST', dataType : 'json', data: JSON.stringify({project_id: project_id}), success: function(response){ if (response.status == "Success"){ $.each(response

Why date is not sorting perfectly in Datatables?

China☆狼群 提交于 2021-02-08 11:14:04
问题 I have try many ways to sort date in dataTables but not working perfectly (asc or desc). I referred to any place to find the solution but not solve. Below are the method that I have tried but not working. Use Date Eu plugin. Here 1 , Here 2 , Here 3 JS function loadtable(){ var project = ''; $.ajax({ url : url, crossDomain: true, type : 'POST', dataType : 'json', data: JSON.stringify({project_id: project_id}), success: function(response){ if (response.status == "Success"){ $.each(response

TypeError: this.$el.DataTable is not a function( REACT.JS)

落爺英雄遲暮 提交于 2021-02-08 10:00:48
问题 BACKGROUND: Hello, i am newbie to react and currently building an application which has datatables . PROBLEM: It runs on the local machine(pc) perfectly but when i use the same code in codesandbox then i get TypeError: this.$el.DataTable is not a function. I have tried using datatable & jquery cdns inside the index.html file but it doesn't have any effect. Any hint ,suggestion would be helpful, thanks in advance. CODE : https://codesandbox.io/embed/jjwx6n2r93 回答1: There were two issues in

Vertical Scroll settings effecting horizontal scrolling with Datatables

荒凉一梦 提交于 2021-02-08 06:41:21
问题 I am trying to create a datatable that has vertical but not horizontal scrolling. The create table statement I am using here as follows: $(document).ready( function () { $('#order-attention-table').DataTable( { "bFilter": false, "scrollY": 300, "scrollX": false, "paging": false, "ordering": false, "info": false, }); } ); Currently my columns are wider than the screen and this causes a horizontal scroll bar to appear even with "scrollX": false. The only way I can get the horizontal scrollbar

jQuery Datatables - retrieving information from other pages

痴心易碎 提交于 2021-02-08 05:09:51
问题 I have got a problem with getting information from jQuery datatable. Here is the table: I would like to get information stored in the table. I have tried to do this by this: var languages=[]; var people=[]; $("select[name='languageID']").each(function(){ languages.push( $(this).val() ); }); $("input:hidden[name='personID']").each(function(){ people.push( $(this).val() ); }); but it is getting values from current chosen page. If I run this in the situation like on the screenshot, only values

Datatables. How to loop through all rows and get id of each tr entry

橙三吉。 提交于 2021-02-08 04:29:29
问题 This questions targets to Datatables plug-in for JQuery . I need to loop through all table rows (even paginated) and get id of each tr element. HTML table like this: <table> <thead> <tr> <th>Header content 1</th> <th>Header content 2</th> </tr> </thead> <tbody> <tr id="etc_1_en"> <td>Etc 1</td> <td>Etc 2</td> </tr> <tr id="etc_1_ru"> <td>Etc 3</td> <td>Etc 4</td> </tr> <tr id="etc_1_fr"> <td>Etc 5</td> <td>Etc 6</td> </tr> <tr id="etc_2_en"> <td>Foo 1</td> <td>Foo 2</td> </tr> <tr id="etc_2

Shiny datatable: popup data about selected row in a new window

梦想的初衷 提交于 2021-02-07 18:17:21
问题 I have a datatable in shiny. When a user selects a certain row, I want to display some other data based on the selected row in a new window. I tried to use shinyBS package but I could not use it without action button and I don't want to include action button. I want the pop up to display when a row is selected. Any ideas? mymtcars = head(mtcars) for_pop_up = 1:6 app <- shinyApp( ui = fluidPage( DT::dataTableOutput("mydatatable") ), server = shinyServer(function(input, output, session) {

Shiny datatable: popup data about selected row in a new window

孤者浪人 提交于 2021-02-07 18:16:31
问题 I have a datatable in shiny. When a user selects a certain row, I want to display some other data based on the selected row in a new window. I tried to use shinyBS package but I could not use it without action button and I don't want to include action button. I want the pop up to display when a row is selected. Any ideas? mymtcars = head(mtcars) for_pop_up = 1:6 app <- shinyApp( ui = fluidPage( DT::dataTableOutput("mydatatable") ), server = shinyServer(function(input, output, session) {