datatables

Datatable sort by date correctly

孤街浪徒 提交于 2019-12-24 20:03:56
问题 I'm using Django framework for my web site but to show info I use the plugin Datatable so one column show date info, the format that is used to show the date is like May. 6, 2017 so when I sort the date column take the order as string and not date so the first date to show is like August 10, 2017 Is there a way to sort by date using that format? 回答1: When defining the columns of your DataTable, you need to specify the render callback as in the example below: columns: [ { title: "Date", data:

load custom response in datatable using server side processing

别说谁变了你拦得住时间么 提交于 2019-12-24 19:29:45
问题 I am trying to load datatable from ajax response and then perform server-side processing. using this example this is the response I am receiving from server : {"msg":null,"code":null,"status":null,"result":[{"aNumber":"3224193861","bNumber":"3215910681","dateTime":"2017-06-05 09:44:22.0","duration":778,"imei":"47350901163665"},{"aNumber":"3224193861","bNumber":"3028540439","dateTime":"2017-04-26 18:53:23.0","duration":266,"imei":"31489802062929"}],"draw":1,"limit":1000,"recordsFiltered":13419

How to change the value of a cell in datatables.net? [duplicate]

吃可爱长大的小学妹 提交于 2019-12-24 19:24:42
问题 This question already has answers here : Update Jquery Datatable Cell Value (2 answers) How to update data in datatable column (1 answer) Jquery DataTables - Change Data in Specific Cell Based on Row ID (6 answers) How to change specific jQuery dataTables cell value (1 answer) Closed 2 years ago . I was trying to change a value of cell inside a table with datatables plugin. I tried below codes but it changed the whole row value. var tbl = $('#tbl1').DataTable(); tbl[ 0 ].row( 0 ).data("new

How to display image in datatable?

两盒软妹~` 提交于 2019-12-24 19:18:56
问题 I want to show an image in my datatable.The data to be displayed in the datatable is a json array of arrays like this: data : [["1", "John","image1.jpg"], ["2", "Jim", "image2.jpg"]] So in my database I only have the name of the image and I don't know how to display the image itself. 回答1: It has been asked before, but not with a simple array of arrays datasrc. Use columnDefs to target the index of the image, use render to construct the <img> tag : var table = $('#example').DataTable({ data:

Can't get datatables.net working with javascript [closed]

不问归期 提交于 2019-12-24 19:15:16
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I'm been trying to use the datatables from http://datatables.net/ trying to getting it to work with javascript. but it won't work for me. even when using the example provided by the side, it still does work, just a blank page. Anyone know how to get it to work? <script type="text/javascript" src="code.jquery.com

Dropdown pagination in jQuery DataTables

杀马特。学长 韩版系。学妹 提交于 2019-12-24 17:24:11
问题 Is it possible to have a dropdown pagination like the image below with jquery datatables? 回答1: Yes - with a plug-in such as this: http://datatables.net/plug-ins/pagination#listbox 回答2: With Select pagination plugin list you can achieve this. Import select.js along with your datatable js files. You can use CDN //cdn.datatables.net/plug-ins/1.10.19/pagination/select.js Example: $(document).ready(function() { $('#example').dataTable( { "sPaginationType": "listbox" } ); } ); 来源: https:/

jquery Datatable Row Grouping

ぃ、小莉子 提交于 2019-12-24 17:18:35
问题 I'm using jQuery DataTables (version 1.7.6). I'd like to group two consecutive rows so I can have an edit option for both rows. Here's my table: <table class="display" id="specificproduct_table" width="100%" cellpadding="0" cellspacing="0" border="0" > <thead> <tr> <th width="7%">column1</th> <th width="16%">column2</th> <th width="5%">Edit</th> </tr> </thead> <tbody> <tr> <td colspan="5" class="dataTables_empty"> Loading data from server </td> </tr> </tbody> <tfoot> <tr> <th>column1</th> <th

Data table integrated with Angular not showing export buttons such as Excel, PDF

我与影子孤独终老i 提交于 2019-12-24 17:15:56
问题 "styles": [ "../node_modules/bootstrap/dist/css/bootstrap.min.css", "../node_modules/datatables.net-dt/css/jquery.dataTables.css", "../node_modules/datatables.net-buttons-dt/css/buttons.dataTables.css", "styles.css" ], "scripts": [ "../node_modules/jquery/dist/jquery.min.js", "../node_modules/popper.js/dist/umd/popper.min.js", "../node_modules/bootstrap/dist/js/bootstrap.min.js", "../node_modules/jquery/dist/jquery.js", "../node_modules/datatables.net/js/jquery.dataTables.js", "../node

Hover zoom doesnt work on second page of datatable

天大地大妈咪最大 提交于 2019-12-24 16:14:44
问题 I displayed img thumbnail on last column of databale $.each(data,function(i,d){ d['index']=i+1; url = url d["ad_image"] = '<a href="#" ><img src="'+url+'" class="img-zoom" /></a>' }) table = $('#datatable4').dataTable({ 'paging': true, 'ordering': true, 'info': true, "destroy": true, "aaData" : data, aoColumns: [ { mData: 'index' }, { mData: 'ad_title' }, { mData: 'ad_details' }, { mData: 'ad_image' }, ] }); img-zoom class css : .img-zoom { width: 310px; -webkit-transition: all .2s ease-in

jQuery DataTables filter rows based on multiple values

不羁岁月 提交于 2019-12-24 15:53:22
问题 I am trying to have multiple filters that will hide/show rows on my datatable based on which filters are selected. My plan is to place the filter values in an array and compare those to the data-search attribute in the first column, but what I currently have does not work. Here's a JSfiddle that I have plus code below https://jsfiddle.net/dmcgrew/06j4pxjk/3/ HTML with checkboxes for filters and the table data.. <label> <input type="checkbox" name="cat" value="cat" class="filter"> Cats </label