jquery-datatables

DataTables plug-in - Display scrollbar below tfoot tag?

…衆ロ難τιáo~ 提交于 2019-12-05 11:37:14
I use jQuery DataTables plug-in and "scrollX":true for horizontal scrolling. Why scroll bar appears above tfoot tag? How to make it appear below footer? var table = $('#example') .DataTable( { "scrollX": true, "scrollCollapse": true, "dom": 'Zlrtip', "colResize": { "tableWidthFixed": false, //"handleWidth": 10, "resizeCallback": function(column) { } }, "searching": false, "paging": false, "info": false, "deferRender": true, "sScrollX": "190%" }); See JSFiddle example demonstrating the problem. You need to add the following code to you DataTables initialization options: "fnInitComplete":

jQuery Datatables: how to delete the row

假装没事ソ 提交于 2019-12-05 11:12:13
I want to delete the row from datatable. Here is the datatables code I use: var aSelected = []; oTable = $('.itemPublished').dataTable({ "bJQueryUI": true, "sPaginationType": "full_numbers", "bServerSide": true, "bProcessing": true, "sAjaxSource": "/item/datatable", "bDeferRender": true, "iDisplayLength":20, "aLengthMenu": [[10, 20, 50, 75, 100, 150], [10, 20, 50, 75, 100, 150]], "aoColumnDefs": [ { "bSortable": false, "aTargets": [ 2, 3, 4 ] }, { "sClass": "left", "aTargets": [ 1 ] } ], "fnRowCallback": function( nRow, aData, iDisplayIndex ) { if ( jQuery.inArray(aData.DT_RowId, aSelected) !=

JQuery1.8 Datatables saving state on click of a button

倖福魔咒の 提交于 2019-12-05 10:47:53
I have a jsp with a table and two buttons "home" and "back" in it and have imported jquery.datatable.js in it. On click of "home" the page should load without any pagination or filter saved. and on click of "back" the table should have all the filter and pagination saved. I have tried setting the "bStateSave" flag true while initializing the data table. This always loads the table with the filter and pagination. Is there any way I can load the table with saved state on click of "back" button and its original state on click of "home" button For DataTables 1.10: Below are API functions for

jQuery datatables Twitter/facebook style paging

元气小坏坏 提交于 2019-12-05 08:37:49
I have been searching around for a good resource on how to do this with no luck. I am using the jQuery datatables plugin with serverside processing along with pipelining enabled( example ). I have this working in my asp.net webforms project and will be moving to MVC for future projects. I am taking care of server side processing with the class found Here . I have also been looking through the article found Here related to the pagination. Basically what I need to do is create this type of pagination with the datatables plugin and server side processing(pipelining is not necessarily important

Alert the page no. on jQuery dataTables page change event

只谈情不闲聊 提交于 2019-12-05 05:46:08
The following is working for me: $('#datatable').on('page.dt', function() { alert("changed"); }); Whenever I am changing the page,the alert is shown.But if I want to alert the page no. which is clicked then what's the way table.page.info() returns the current pagination information. That is current page , number of pages , recordsDisplay , recordsTotal and more. var table = $('#datatable').DataTable(); $('#datatable').on('page.dt', function() { var info = table.page.info(); var page = info.page+1; alert('changed - page '+page+' out of '+info.pages+' is clicked'); }); see demo -> http:/

Export value with Linebreaks into single cell in Excel. jQuery Datatables

烂漫一生 提交于 2019-12-05 03:45:19
I am successfully exporting HTML tables from a web application to excel using jQuery DataTables. However one particular column has values containg line breaks and tabs. I have managed to display the data correctly on the HTML table by replacing new lines (\n) and tabs (\t) with <br> and  (x5) respectively. The issue is when exporting to excel i need to have the line breaks back in but keep all the value in one cell. here is my jquery code: $('#papercliptable').dataTable({ "sDom": 'T<"clear">lfrtip', "tableTools": { "aButtons": [{ "sExtends": "xls", "sButtonText": "Excel", "fnCellRender":

get hidden row content from datatable and submit it along with the form

梦想与她 提交于 2019-12-05 03:09:34
问题 I'm stuck with an issue and its eating my time now. I have a table with 7 records (for instance) and this table has input and textarea elements, where a user can type in. Now with pagination having the value as 5 records per page, I have two pages. The user enters data into comments section, clicks on the "next" in the pagination and enters value in the comments section. So technically, the user entered values into both the pages as splitted by datatable pagination logic. The problem is, when

Dynamic HTML Table with Fixed Header and Fixed First column

*爱你&永不变心* 提交于 2019-12-04 23:46:55
问题 I am creating a html table dynamically and filling in its contents. After that I add the complete HTML to a div already on my aspx page. I want to fix the header of the dynamic table and its first column. So far I have tried FixedHeader,datatable and fixedcolumn plugins but nothing seems to be working. Kindly help if I need some css or something else I am missing. 回答1: Hi if are ready to built one of such i can help you with that. check out the following fiddle for demo if it helps.Fiddle

How do I draw Excel-style data bars in a jQuery DataTable?

戏子无情 提交于 2019-12-04 17:36:47
I'm looking to add data bars behind values in a selected column of a jQuery DataTables table, like the Data Bars Conditional Formatting option in Excel. This answer shows a solution of how to achieve this sort of thing with jqGrid. How would I achieve a similar effect in DataTables? Should be pretty easy, using fnRowCallback(). I don't have my sample code onhand, but suffice it to say that if you use the example on datatables.net for fnRowCallback, you can use the data value to create a div of an appropriate width. Let me try hacking it together without real-world testing it... Assume your

Use jQuery datatables server-side processing with mvc. Serialize criteria form and add this parameter to $ajax.post method

余生颓废 提交于 2019-12-04 14:53:45
i'm using mvc and jquery datatables, with serve side processing. I have created two Class Model: the first jQueryParamModel, to pass dataTables parameters to action controller public class JQueryDataTableParamModel { /// <summary> /// Request sequence number sent by DataTable, same value must be returned in response /// </summary> public string sEcho{ get; set; } /// <summary> /// Text used for filtering /// </summary> public string sSearch{ get; set; } /// <summary> /// Number of records that should be shown in table /// </summary> public int iDisplayLength{ get; set; } /// <summary> ///