datatables

Scroll to specific row in Datatable API

送分小仙女□ 提交于 2019-12-25 18:26:39
问题 I need to scroll until specific row in my datatable like this: https://datatables.net/extensions/scroller/examples/initialisation/api_scrolling.html This is my code: <script src="js/jquery-1.12.4.js"></script> <script src="js/jquery-3.1.1.min.js"></script> <script src="js/jquery.dataTables.min.js"></script> <script type="text/javascript" src="https://cdn.datatables.net/scroller/1.4.2/js/dataTables.scroller.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/form

Jquery - Datatable drag and drop changing bg after drop a new name

Deadly 提交于 2019-12-25 17:43:51
问题 I am using: jquery.dataTables.js from: https://datatables.net What I am trying to do is: After dropped (or update) the name from table 2 in in the column on table 1, the bg of this td should change color where the name was updated. Right after the update of the name, nothing happens just the other bg is removed from td from the column name. I would like apply another bg color when the <td> is updated like a fade-in effect showing the td has been updated. Also make the div below appear with a

JQuery DataTable - Search for exact match

五迷三道 提交于 2019-12-25 16:53:44
问题 I have looked at several other responses and tried them all but nothing works. I have the following in my table: Date Severity 2016-04-24 Not Critical 2016-04-24 Critical [what I need returned] 2017-01-09 Not Critical 2017-09-13 Critical I am trying to search for all rows where severity is Critical (value) for 2016 (year). So far I have: table.search( year + " " + value ).draw(); This returns both rows for 2016. How can I get it to return just the row that I need? 回答1: You may need to enable

Inline editing - save new values on button click

霸气de小男生 提交于 2019-12-25 16:39:54
问题 I have following code for jQuery DataTables: Contact.DataTable = $('#otable').DataTable( { "ajax": { "url" : '/Contact/' + Contact.id, "dataSrc": function(check) { return check.data; }, }, "responsive": true, "columns": [ { "data": "id"}, { "data": "category", "sClass": "category" }, { "data": "name", "sClass": "name" }, { "data": "lname" }, { "render": function ( data, type, method, meta ) { return Contact.saveContact(method); } }, ] } ); Datatable - dropdown - inline edit: $('#otable tbody'

how to select multiple values in a drop down Data tables

夙愿已清 提交于 2019-12-25 16:38:26
问题 I am new to jquery and Data tables. I have a drop down when user select one value it will search the data and draw a table.This search and drawing a table both are default properties of data tables. Now i want the user can select multiple value. And based on the multiple selection the search should happen.I did lot of search on this but didn't get any thing. Any help will be appreciate !! In this image i have selected one value from drop down and based on that two entries are populating on

Jquery Datatables is giving an error when clicking on a checkbox

三世轮回 提交于 2019-12-25 16:09:35
问题 I am using jquery datatables plugin: https://www.datatables.net/download/index .. I have a table header that is generated using jquery. I added a checkbox to one of the columns of the table. Each time I click on that checkbox, I get the following error: Uncaught TypeError: Cannot assign to read only property 'length' of false I went to look in the code for jquery and here is what I see in my console: For reference, the function causing an error is: function _fnSortListener ( settings, colIdx,

Datatables - Json output - PostgreSQL - Returns null

会有一股神秘感。 提交于 2019-12-25 14:25:37
问题 I use datatables. I use it in conjunction with a Postgresql server. I want to take the data from the Postgresql server. I use the script found on: http://datatables.net/development/server-side/php_postgres The script works and creates the json file. The problem is that the values on the json file are null. This is what it returns: {"sEcho":1, "iTotalRecords":4, "iTotalDisplayRecords":4, "aaData":[[null,null,null], [null,null,null], [null,null,null], [null,null,null]]} Also what i don't

How to get current table id to add to ajax data when initialisation is used for multiple tables?

风格不统一 提交于 2019-12-25 13:19:48
问题 I have the following initialisation for multiple tables with the same class but different id attributes: var $table = $('table.jobs'); $table.DataTable({ .... ajax: { url: '/my-url', dataSrc: function (json) { return json.data }, data: function(data) { data.table_id = $table.attr('id'); // gives the same id for all tables } }, ... }); Is there a way I can identify which table is sending the ajax request? I'm trying to avoid duplicating the entire initialisation for every table. 回答1: You can

Jquery DataTables.net: Failing to put negative int in table

天大地大妈咪最大 提交于 2019-12-25 12:43:27
问题 I have an API that returns some negative numbers for the Id field. Here is my datatables script: $(document).ready(function () { $('#myTable').DataTable( { ajax: { url: '@Url.Content("~/api/cas/nodes/all/lastcondition/")', "columns": [ { "type" : "num", "data": "Id"}, { "data": "Name" }, { "data": "Alias" }, { "data": "DateQuery" }, { "type" : "num", "data": "Condition" }, { "type" : "num", "data": "TimeSecLastCondition" } ] } } ); }); JSON returned from ajax query: { "data": [{ "Id":

Exporting jquery datatable to excel with additional rows is not working IE

心已入冬 提交于 2019-12-25 12:43:09
问题 I am trying to export datatable using jquery export button options to excel sheet. And i want additional rows to be added before the table data in excel file. I made a similar demo in fiddle https://jsfiddle.net/xevpdeo1/17/ . It is working fine in Chrome and Firefox but not in IE. In IE the additional rows before the table data is empty after exporting. Can someone help me out with this? Thanks in advance $(document).ready(function() { var xlsBuilder = { filename: 'business-group-sharers-',