datatables

How to get filtered row count

别来无恙 提交于 2020-01-11 04:58:18
问题 I have been trying to get the row count of my table after filtering, but I can't even get it to respond back with the row count initially. My table is rendered via HTML5 and populated by PHP which all works correctly. <table id="table_books" class="table datatable" data-searchplaceholder="Search books..." data-margindifference="70" > <thead> <tr> <th style="width:30px;"><i class="fa fa-code" title="click"></i></th> <th>Column1</th> <th>Column2</th> <th>Column3</th> <th class="text-right

How to use server side option in Angular DataTables with the Angular way example?

浪子不回头ぞ 提交于 2020-01-11 03:34:29
问题 I'm trying to use Angular DataTables with the server side processing option, but when I try to enable it in their "Angular way example", only the first request gets rendered, the subsequent requests (paging, ordering, searching) are sent but they never update the table. 回答1: After a little digging, I found an unrelated user contributed note that suggests that you override the ajax option with your own function to handle the server side call. The trick here is to return an empty array to the

How to disable a search/filter on a specific column on a datatable?

好久不见. 提交于 2020-01-10 17:01:51
问题 My datatable has 5 columns and I need to disable filtering for the 3rd, 4th and last column. please help!!! this is the javascript: <script type="text/javascript" language="javascript" class="init"> $(document).ready(function() { // Setup - add a text input to each footer cell $('#example tfoot th').each( function () { var title = $('#example thead th').eq( $(this).index() ).text(); $(this).html( '<input type="text" placeholder="Search '+title+'" />' ); } ); // DataTable var table = $('

Datatables / TableTools: format data as text when exporting to Excel

半腔热情 提交于 2020-01-10 02:59:28
问题 I am using the Datatables TableTools plugin in order to provide an Export to Excel option for a table on my page. In general everything works as intended. My only issue is that I would need all the data resp. the columns in the resulting Excel table being formatted as text as otherwise I am losing data in some columns. Examples: - I have a column that has leading zeros (e.g. 0022 ) which only appears with the leading zeros cut off (e.g. 22 ) in the Excel file if this is not formatted as text.

【前端】jQuery DataTables 使用手册(精简版)

て烟熏妆下的殇ゞ 提交于 2020-01-07 12:37:46
本文转载自: https://www.cnblogs.com/shamoyuu/p/5182940.html 作者:shamoyuu 转载请注明该声明。 转载请注明出处: http://www.cnblogs.com/shamoyuu/p/5182940.html 前排提醒,这个插件能不用就不用,那么多好的插件等着你,为什么要用它呢?就算用easyui的datagrid然后自己改样式都比这强得多。 在引入easyui的css后,引入下面的css,就可以把easyui的datagrid变成bootstrap的风格了。 /* =================== easyui datagrid begin ======================= */ .datagrid-row:nth-child(odd) { background : #F0F0F0 ; } .datagrid-header td, .datagrid-body td, .datagrid-footer td { border-style : solid ; } .datagrid-row, .datagrid-header-row { height : 40px ; } .datagrid-header, .datagrid-td-rownumber { background : #FFF ; }

How to highlight a substring containing a random character between two known characters using javascript?

这一生的挚爱 提交于 2020-01-07 05:46:07
问题 I have a bunch of strings in a data frame as given below. v1 v2 ARSTNFGATTATNMGATGHTGNKGTEEFR SEQUENCE1 BRCTNIGATGATNLGATGHTGNQGTEEFR SEQUENCE2 ARSTNFGATTATNMGATGHTGNKGTEEFR SEQUENCE3 I want to search and highlight some selected substrings within each string in v1 column. For example, assuming first letter in the substring being searched as "N" and the last letter as "G", and the middle one could be any letter as in "N A G" or "N B G" or "N C G" or "N D G" and so on. To highlight the

Determine child-most element clicked on for Javascript event (DataTable related)

江枫思渺然 提交于 2020-01-07 03:04:27
问题 It might be that the way I'm approaching this just won't work, but to explain: I have a DataTable with column sorting enabled via the default column header sorting graphic. In one of the column headers I also have a "select all" checkbox. The sorting and the "select all" both work, but I can't seem to prevent the sort operation from taking place when clicking on the select all checkbox. The problem seems to be that the DataTables sort function is called ahead of the select all operation - in

DataTables DT: reset value of clicked cell

我怕爱的太早我们不能终老 提交于 2020-01-07 02:57:13
问题 I wanted to add the functionality of something happening after a table cell was clicked (e.g. open a modal). Because (suppose my dt is has the ID "dt") input$dt_cell_clicked stays the same until I click a new cell, I cannot execute the same event on re-clicking that cell. I tried working around it resetting input$dt_cell_clicked with javascript manually. This works, but there seems to be an internal updatemarker in DT that noticed I clicked the cell before and does not set the value of input

Display only users with a specific role in meteor-tabular table

二次信任 提交于 2020-01-07 02:39:52
问题 My site allows users to apply by connecting their google account, as soon as an account is created they're given a "pending" role (using alanning:roles package). I would like to have a table for admins to see when new applicants have applied, from there the admin can properly manage the users application (change role to accepted, declined, etc.). So, I have created my table, but it's showing all users, I'm wondering if someone knows a way to make it so only users with the "pending" role are

Datatables and jQuery $.post

假装没事ソ 提交于 2020-01-07 02:33:27
问题 I have a datatables table in my webpage with more than one page of paginated data in it. Per the example given by datatables, I use the following javascript/jQuery to submit the form: <script> var oTable; $(document).ready(function() { $('#form').submit( function() { var sData = oTable.$('input').serialize(); $.post('', sData); // WORKS // $.post('', sData, $('body').html(data)); // DOES NOT WORK return false; } ); oTable = $('#meters').dataTable(); } ); </script> When I post via $.post('',