jquery-datatables

Sending data to the server with fnServerParams and aoData for jquery DataTable does not work in MVC4

孤街醉人 提交于 2019-12-06 10:08:26
I want to send extra data to serverside (ASP.Net MVC4) for my jquery datatable. There are many examples on how to this client side, but I can't get it to work on the serverside. Here's the code: javascript: $(document).ready(function () { var oTable = $('#myDataTable').dataTable({ "bServerSide": true, "sAjaxSource": "SearchPatient/DataHandler", "fnServerParams": function (aoData) { alert('in fnServerParams'); aoData.push( { "name": "more_data", "value": "my_value" } ); } }); }); Note: the alert goes off, so the function itself is working. My model class: /// <summary> /// Class that

Datatables with best_in_place not allowing updating

痞子三分冷 提交于 2019-12-06 07:42:05
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 LocationsController#update as JSON Processing by LocationsController#update as JSON Parameters: {"location"=>{

export data to excel not working in datatables

陌路散爱 提交于 2019-12-06 07:36:51
问题 export data and TableTools not working for me, after adding this line between head: <script type="text/javascript" language="javascript" src="../../components/dataTables/media/js/jquery.dataTables.min.js"></script> <script type="text/javascript" language="javascript" src="../../components/dataTables/media/js/ZeroClipboard.js"></script> <script type="text/javascript" language="javascript" src="../../components/dataTables/media/js/TableTools.js"></script> and change table id prop in this: $('

Populate Datatable with Ajax call

回眸只為那壹抹淺笑 提交于 2019-12-06 05:33:30
I want to display the values into the table using an AJAX call. The code used for it is, initTable(); function initTable (){ return $('#exEmpListTable').dataTable({ "bPaginate": false, "sScrollY": "200px", "bScrollCollapse": true }); } function tableActions (){ var oTable = initTable(); // perform API operations with oTable oTable.fnSort( [ [1,'desc']] ); } $("#btnShowExEmpList").click(function (e){ var selectedShop = $('#Shop').val(); if(selectedShop == null){ alert(" Please select a shop first "); return false; } if(selectedShop != null){ alert("==== Selected Shop ==== "+selectedShop); var

JQuery DataTable not working on Meteor

一曲冷凌霜 提交于 2019-12-06 04:14:53
I am trying to implement jQuery DataTables in my Meteor project, but I am always getting the following error. Can someone please tell me what I am missing / doing wrong here? Below is my Meteor app code. Thanks. Uncaught TypeError: Cannot set property 'pagesData' of undefined underscore.js:848 Error: Exception from Tracker recompute function: Error: Can't call non-function: undefined at Spacebars.call (http://localhost:3000/packages/spacebars.js?cb20740019f26bdca2faa89ba9c973f618118521:172:13) at Spacebars.mustacheImpl (http://localhost:3000/packages/spacebars.js

how to disable a DataTables/TableTools button

╄→尐↘猪︶ㄣ 提交于 2019-12-06 03:14:08
问题 I'm using DataTable 1.10 and TableTools 2.2.1. Given the following snipped I would like to disable/enable the edit-button. var myTable = $("#myTable ").DataTable({ tableTools : { "aButtons" : [ { "sExtends" : "text", "sButtonText" : "Edit", "fnClick" : function(nButton, oConfig, oFlash) { /* some stuff */ } }] } }) Is there a possibility to do this at runtime? Thanks a lot 回答1: This was a good question! Seems that the fnClick in dataTable.tabletools().fnSettings().buttonSet[id].fnClick only

datatables add combobox as a column

与世无争的帅哥 提交于 2019-12-06 02:23:05
I have got a datatable using Datatables . I have created and filled the table as shown below. Now I need to implement a combobox (assume that I have got 2010, 2011,2012) to allow the user select a year . then when user clicks View or Modify link, which is placed in the table, selected year will be passed to another page as a parameter. Now how can I turn my year column into a combobox? rulesTableGlobal = $('#rulesTable').dataTable( { //"bJQueryUI": true, "sPaginationType": "full_numbers", "aoColumns": [ { "sTitle": "Id", "sWidth" : "20px" }, { "sTitle": "Property ID" , "sWidth" : "20px"}, {

How to use a link in TableTools instead of flash buttons

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 00:48:56
问题 I'm trying to find a way to change the buttons on TableTools. I'd like to use my own customized links instead of the flash buttons. Is there a way I can do that? Any good resource teaching me how to make that modification and still able to use the functionalities, like button collection, etc. 回答1: According to the creator, the only way to get the TableTools export functionality is by using the Flash buttons. The other threads that you found should say that currently, no, this is not an option

Datatable colspan sorting

喜夏-厌秋 提交于 2019-12-05 18:16:29
Datatable jquery plugin gives error when colspan or rowspan is introduced. Is there any other way of getting through it. 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 }); }); Datatables does not support colspan. You can add a detail row to the table that can be any format, like on click expand the row. Datatables Colspan Row

DataTables Server Side Individual Column Filtering

心不动则不痛 提交于 2019-12-05 16:13:25
I was hoping someone can help me with this. I have been running myself crazy with this. I have a situation where I load the DataTables grid (awesome piece by the way!) and all is great. Then I go to search and I run into problems. The data being populated in the grid is coming from two different database tables (which is fine) but when someone executes a search I have no way of knowing where to go and get the data. I would need to know what criteria the search is about (i.e. title or contact). I see what when the search is called from the server via the default search box there are variables