tablesorter

making html table columns optionally sortable

左心房为你撑大大i 提交于 2019-12-10 12:18:35
问题 I have an html table that is populated from a text file, formatted and semi colon separated. I would like the user to have the option of sorting alphabetically with either of the columns when clicking on the column name (header). How do I do this in php?? Or is there another way of doing this? Thanks for your help. Sample raw data/input looks like this: TYPE=abc;PART=georgetown;FILE=goog_abc.dat.2010122211.gz TYPE=xyz;PART=ucny;FILE=aol_xyz.dat.2010122209.gz Php code for table: $lines = preg

Tablesorter and multi textExtraction in jQuery?

笑着哭i 提交于 2019-12-10 09:43:04
问题 I have this table which has TableSorter plugin. Jsbin #1 However - I want for column #1 ( second zero based) to be sorted by the first char second char as digit !) example : 4134 (I dont care about the other digits order - just the first one which is here=1) 22230 //2 242 //4 67 //7 28 //8 992222 //9 So I created another textExtraction function : ( which is going to be applied only at the first column) var myExtraction = function(node) { return parseInt($(node).substring(1)) } and added

i have a array object like this, i want to sort this array based on _0 attribute, please suggest some solution in Javascript or Dojo

让人想犯罪 __ 提交于 2019-12-08 14:23:50
问题 [ {Devices:"All Devices",Groups:"Location/All Locations", id:"table-default00",_0:0}, {Devices:"All sourecs",Groups:"Location/All Locations", id:"table-default01",_0:1} ] 回答1: You can pass a custom function to the Array#sort method. The return value of this function decides the order of the elements. const data = [{ Devices: "All Devices", Groups: "Location/All Locations", id: "table-default00", _0: 0 }, { Devices: "All sourecs", Groups: "Location/All Locations", id: "table-default01", _0: 1

How to ignore th with specific class name in tablesorter?

孤人 提交于 2019-12-08 12:25:31
问题 I use the tablesorter to sort the table, but not all columns, I want to ignore the specific column with the defined class name, eg: <table class="basicList" cellpadding="0" cellspacing="0"> <thead> <tr> <th class="ck_field"><input type="checkbox" id="check_all" name="check_all" /></th> <th class="col_filter"><a href="#" class="btn_filter"> </a></th> <th>Name <span class="sort_indicator"> </span></th> </tr> <tr class="filter_row"> <td> </td> <td> </td> <td> <input type="text" id="the_name"

jQuery tablesorter - sorting a column with mixed text and numbers

亡梦爱人 提交于 2019-12-08 05:30:09
问题 I have a table with a column of data that is mixed text and numbers. I'm sorting it using jQuery and the tablesorter plugin. The data that won't sort correctly is equipment tags, for example, "AHU-1", "AHU-2", "AHU-10". The problem is, given those example values, AHU-10 will be placed between AHU-1 and AHU-2. I've found forcing a 'digit' sort doesn't solve the problem. Here's my question: 1) Does anyone know of an existing parser that I can use in this situation? If there isn't one then I'll

tablesorter select multiple options from select dropdown menu and custom time filter?

北城余情 提交于 2019-12-08 05:27:06
问题 Is there any way to select multiple options from the select dropdown menu and display the result. Like in my fiddle I have first name as the first column and want to select and display Aaron and Clark's time. Individually its possible. But what about if two options need to be selected. How's that got to be achieved? And, how do apply custom time filters like Morning (between 6 to 12) Afternoon (between 12 to 18) Evening (between 18 to 21) Here is what I tried, but it does not work. Infact,

Can't get Tablesorter Checkbox Filtering to work

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 04:51:11
问题 I'm trying to get a tablesorter filter plugin to work with checkboxes. The default they show is a string textbox sort: filterContainer (string) - The DOM id of the input box where the user will type the search string. The default is "#filter-box". .tablesorterFilter({filterContainer: "#filter-box", filterClearContainer: "#filter-clear-button", filterColumns: [0]}); . <input name="filter" id="filter-box" value="" maxlength="30" size="30" type="text"> And I'm trying to do a checkbox filter, and

Tablesorter n[0] undefined

混江龙づ霸主 提交于 2019-12-07 19:38:26
I am having issues with the tablesorter. The error is: n[0] is undefined function appendToTable(table,cache) { if(table.config.debug) {var appendTime = new Date()} var c = cache, r = c.row, n= c.normalized, totalRows = n.length, checkCell = (n[0].length-1), tableBody = $(table.tBodies[0]), rows = []; for (var i=0;i < totalRows; i++) { rows.push(r[n[i][checkCell]]); if(!table.config.appender) { var o = r[n[i][checkCell]]; var l = o.length; for(var j=0; j < l; j++) { tableBody[0].appendChild(o[j]); } //tableBody.append(r[n[i][checkCell]]); } } Above is a code snippet from the jquery.tablesorter

tablesorter how to set dynamic scroller height

邮差的信 提交于 2019-12-07 18:58:26
问题 I'm trying to use Tablesorter with the scroller widget. same as this - http://jsfiddle.net/Mottie/856bzzeL/146/ The widget options is asking for scroller_height . my table is dynamic so i can't tell the table height since i don't know how many rows i have. I tried to delete the scroller_height but there is a default out there. How can i get the full table rows without vertical scroller and with sticky header? 回答1: It sounds like you want a sticky header and not the scroller widget. There are

Custom Parser for Tablesorter plugin for custom date format

倾然丶 夕夏残阳落幕 提交于 2019-12-07 15:28:58
问题 I need to adapt the jQuery Tablesorter plugin to sort dates in a very simple format which will consist of the three letter month and the 4 digit date (e.g. May 2010, Jan 2011, Mar 2012, etc). I have'nt been able to wrap my head around how to do it. I tried adapting the parser found here: http://beausmith.com/blog/custom-date-sorting-for-jquery-tablesorter-plugin/. But I am lost with reg ex. For ease in helping, I will post his code below. // TableSort parser for date format: Jan 6, 1978 $