jquery-datatables

How to get the value of a hidden field in Jquery DataTable

偶尔善良 提交于 2019-12-23 15:17:10
问题 My code is listed below $("#tblAdminUsers").dataTable({ bProcessing: true, sAjaxSource: '@Url.Action("FetchAdminUsers", "Admin")', aoColumns: [ { sTitle: "Id", bSortable: false, "bVisible": false }, { sTitle: "Email", bSortable: false, }, { sTitle: "Location", bSortable: false, }, { sTitle: "Status", bSortable: true, }, { sTitle: "UserType", bSortable: false, }, { sTitle: "Actions", bSortable: false, mRender: function (nRow, aData, iDisplayIndex) { return '<i class="ui-tooltip fa fa-pencil

jQuery DataTables add country icons each column

北慕城南 提交于 2019-12-23 09:53:38
问题 I want to add in DataTables a country icon on each country column (with jQuery) which is the same as the text that is displayed on that column. So when it contains the country US then there is a image before the text that will link to us.png . So, from this: to this: (Edited in Chrome DevTools) I think it can be done with aaData, but I don't know how to use that without replacing the whole column. Somebody has an answer? 回答1: Use the fnRowCallback . Refer this example from the datatables

DataTables Error : “Requested unknown parameter”

十年热恋 提交于 2019-12-23 05:26:00
问题 var headers = [{ "mDataProp": "Agents" },{ "mDataProp": "Buyer" },{ "mDataProp": "Date" }]; $(document).ready(function () { $('#data-table').dataTable({ "bFilter": false, "bLengthChange": false, "iDisplayLength": 25, "bJQueryUI": true, "bServerSide": true, "bProcessing": true, "sPaginationType": "full_numbers", "aoColumns": headers, "sAjaxSource": '/report/TestPaging', }); }); If I remove the aoColumns from my code the datatable is generated normally, but when I add aoColumns I get :

Put a class depending on the data ajax datatables

こ雲淡風輕ζ 提交于 2019-12-23 04:13:17
问题 I searched alot and I'm extremely sure it can be done easily but I cannot find a way to do it. So I use jQuery DataTables and I'm trying to generate a class and do a few javascript action depending on the value I'm recieving. For example, something as simple as putting a red background when the unit is negative, etc. I already created my CSS for this and now I'm loading a JSON file via the ajax parameters of DataTables. Here's my javascript: table = $('#activitiesTable').DataTable({ "ajax":

Datatables with best_in_place not allowing updating

 ̄綄美尐妖づ 提交于 2019-12-22 12:32:30
问题 I am attempting to use best_in_place with datatables to allow for updating of table entries in-line. However, I have everything rendering correctly and can edit the entry, the change does not persist and same to the database and throws the log below. At present I am just looking to edit the store id and address information: Started PUT "/locations/104" for 127.0.0.1 at 2015-05-02 16:15:17 -0400 Started PUT "/locations/104" for 127.0.0.1 at 2015-05-02 16:15:17 -0400 Processing by

Datatables with best_in_place not allowing updating

前提是你 提交于 2019-12-22 12:30:01
问题 I am attempting to use best_in_place with datatables to allow for updating of table entries in-line. However, I have everything rendering correctly and can edit the entry, the change does not persist and same to the database and throws the log below. At present I am just looking to edit the store id and address information: Started PUT "/locations/104" for 127.0.0.1 at 2015-05-02 16:15:17 -0400 Started PUT "/locations/104" for 127.0.0.1 at 2015-05-02 16:15:17 -0400 Processing by

Datatable colspan sorting

喜你入骨 提交于 2019-12-22 09:24:38
问题 Datatable jquery plugin gives error when colspan or rowspan is introduced. Is there any other way of getting through it. 回答1: Just do it manually with some jQuery: $(function(){ var tableRows = $('#myDatatable tbody tr'); $.each(tableRows, function (index, value) { var cells = $(value).find('td'); $(cells[1]).remove(); // for example I want to remove cell 1 $(cells[0]).attr('colspan','2'); // for example I want to set colspan = 2 for cell 0 }); }); 回答2: Datatables does not support colspan.

Select all rows in active page only jquery Datatable

二次信任 提交于 2019-12-21 20:44:11
问题 I'm using jquery datatable on a gidview and there is a checkbox on the datatable header. The purpose of that checkbox is to check all checkboxes in the current page of the gridview rows. So am using the function var table = $('#Tab_ApplicantList').DataTable(); var rows = $('#Tab_ApplicantList').dataTable().fnGetNodes(); $(rows).each(function () { $(this).find("input.grey").iCheck('check'); }); But the problem is it is selecting all rows in the datatable, not just the rows in the active page.

DataTables.js Sort columns containing HTML links with integer text

◇◆丶佛笑我妖孽 提交于 2019-12-21 02:44:11
问题 I'm trying to sort columns in DataTables.js that contain HTML anchor tags. The text within the anchor tag is an integer, like <a href="#">123</a> . I want to sort the columns numerically. In the documentation examples, there is DataTables HTML sorting auto-detection example. I tried this but it doesn't solve my issue - it does correctly parse the text out of the HTML, however, it treats the resulting text as a string and not an integer. Example output: 0, 0, 1, 14, 67, 67, 7 Desired output: 0

jQuery dataTables - get filtered column values

半世苍凉 提交于 2019-12-20 18:29:10
问题 I am using a jQuery dataTable and when the user selects a drop down it searches the data table and filters it and redraws the contents based upon the searched data : mtTable.columns().each(function() { mtTable.column(22).search(searchVal, true, true).draw(); }); Now I am trying to get all of the column values after a search is done, however I cannot find a function to do this. Currently I am using from the api var myTable = $("#tblResults").DataTable(); var resultsArray = myTable.columns