tablesorter data-math-filter returns no results when given a valid css selector - tablesorter

I'm using Mottie's tablesorter plugin with the Math extension. I have a conditionally formatted table - the categories of conditional formatting are indicated in a data-color attribute on the data cell.
In the footer, I have several rows that summarize the values of the conditional formatting. The footer cells are decorated with data-math-filter="[data-color='color1']".
<table>
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
</tr>
</thead>
<tbody>
<tr>
<td data-color='red' style='background-color:red'>
3
</td>
<td data-color='blue' style='background-color:blue'>
7
</td>
</tr>
<tr>
<td data-color='green' style='background-color:green'>
6
</td>
<td data-color='red' style='background-color:red'>
4
</td>
</tbody>
<tfoot>
<tr>
<td data-math-filter='[data-color="red"]' data-math='col-sum'></td>
<td data-math-filter='[data-color="red"]' data-math='col-sum'></td>
</tr>
<tr>
<td data-math-filter='[data-color="green"]' data-math='col-sum'></td>
<td data-math-filter='[data-color="green"]' data-math='col-sum'></td>
</tr>
<tr>
<td data-math-filter='[data-color="blue"]' data-math='col-sum'></td>
<td data-math-filter='[data-color="blue"]' data-math='col-sum'></td>
</tr>
</tfoot>
</table>
My reading of the docs leads me to believe that the math function will filter for the data-elements - but it doesn't seem to work. I've tried a bunch of different CSS filters - nothing seems to work.
What am I doing wrong?

Related

How to hide the Property name

It's a lot that I used MVC but I need to create a widget using Abp.IO,
What I currently got is
But I want to hide this SenzaAgente and ConAgente, I think this is generated since I use abp-input and it get the value of the property, does exist a way of hiding it and gaining the space (The SENZA Agente on the left should be on the same line of the number)
The code I used is
<abp-table hoverable-rows="true" responsive-sm="true">
<tbody>
<tr>
<td></td>
<td>% RINCARO</td>
</tr>
<tr>
<td>SENZA Agente</td>
<td><abp-input readonly="true" asp-for="#Model.Rincaro.SenzaAgente"></abp-input></td>
</tr>
<tr>
<td>CON Agente</td>
<td><abp-input readonly="true" asp-for="#Model.Rincaro.ConAgente"></abp-input></td>
</tr>
</tbody>
</abp-table>
You can use suppress-label="true" attribute
<abp-table hoverable-rows="true" responsive-sm="true">
<tbody>
<tr>
<td></td>
<td>% RINCARO</td>
</tr>
<tr>
<td>SENZA Agente</td>
<td><abp-input suppress-label="true" readonly="true" asp-for="#Model.Rincaro.SenzaAgente"></abp-input></td>
</tr>
<tr>
<td>CON Agente</td>
<td><abp-input suppress-label="true" readonly="true" asp-for="#Model.Rincaro.ConAgente"></abp-input></td>
</tr>
</tbody>
</abp-table>

how to add table with nested values

I want to display terms attribute using thymeleaf. I tried like
<table>
<tr th:each="term: ${contractMap.contractTerms}">
<td><table>
<tr th:each="termRow: ${term.rows}">
<td><table>
<tr th:each="atr: ${termRow.attributes}">
<td th:text="${atr.value}"></td>
</tr ></table>
</td>
</tr>
</table>
</td>
</tr>
</table>
But it is not working.

How to set the highchart and the table horizontally?

This is what my highchart looks like atm
I kinda want the chart to be on the right side while the table to be on the left
this is my html:
<div id="words" style="width:70%;float:left;">
<table border="1" class="highchart" data-graph-container-before="1" data-graph-type="column">
<thead>
<tr>
<th>Word</th>
<th>Count</th>
</tr>
</thead>
<tbody>
<tr>
<td>icon</td>
<td>12</td>
</tr>
<tr>
<td>text</td>
<td>12</td>
</tr>
<tr>
<td>your</td>
<td>9</td>
</tr>
<tr>
<td>post</td>
<td>6</td>
</tr>
<tr>
<td>document</td>
<td>5</td>
</tr>
<tr>
<td>with</td>
<td>5</td>
</tr>
<tr>
<td>parentNode</td>
<td>4</td>
</tr>
<tr>
<td>email</td>
<td>4</td>
</tr>
<tr>
<td>com"</td>
<td>4</td>
</tr>
<tr>
<td>googletag</td>
<td>3</td>
</tr>
</tbody>
</table>
What should i do to achieve such output?
If you can change HTML, then simply put table before Highcharts container and set proper styles (float, width). For example you can also use two divs: http://jsfiddle.net/68qdew8g/
<div style="float: left; width: 30%;">
<table border="1" class="highchart" data-graph-container-before="1" data-graph-type="column">
...
</table>
</div>
<div id="words" style="width:70%;float:left;"></div>

How to generate <table> compatible with jQueryMobile in TYPO3

I'm trying to create a jQueryMobile compatible <table> with TYPO3.
It means adding data-role="table" and class="class="ui-responsive"".
This table can be generated with RTE or a Table Content Element.
RTE
Default <table> HTML
<table style="" class="contenttable">
<thead>
<tr>
<th scope="col">head 1</th>
<th scope="col">head 2</th>
<th scope="col">head 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>L 1</td>
<td>...</td>
<td>...</td>
</tr>
<tr>
<td>L 2</td>
<td>...</td>
<td>...</td>
</tr>
</tbody>
</table>
attempt to solve problem
I've added the following setup but jQuery seams not to work anymore. It load (spinning animation) indefinitely.
lib.parseFunc_RTE.externalBlocks.table.stdWrap.HTMLparser.tags.table.fixAttrib.data-role.always = 1
lib.parseFunc_RTE.externalBlocks.table.stdWrap.HTMLparser.tags.table.fixAttrib.data-role.default = table
lib.parseFunc_RTE.externalBlocks.table.stdWrap.HTMLparser.tags.table.fixAttrib.class.default = ui-responsive
lib.parseFunc_RTE.externalBlocks.table.stdWrap.HTMLparser.tags.table.fixAttrib.class.list = ui-responsive
Content Element
Default <table> HTML
<table class="contenttable contenttable-0 test">
<thead>
<tr class="tr-even tr-0">
<th class="td-0" scope="col" id="col162967-0">head 1</th>
<th class="td-1" scope="col" id="col162967-1">head 2</th>
<th class="td-last td-2" scope="col" id="col162967-2">head 3</th>
</tr>
</thead>
<tbody>
<tr class="tr-odd tr-1">
<td class="td-0" headers="col162967-0">L 1</td>
<td class="td-1" headers="col162967-1">...</td>
<td class="td-last td-2" headers="col162967-2">...</td>
</tr>
<tr class="tr-even tr-last">
<td class="td-0" headers="col162967-0">L 2</td>
<td class="td-1" headers="col162967-1">...</td>
<td class="td-last td-2" headers="col162967-2">...</td>
</tr>
</tbody>
</table>
attempt to solve problem
I don't find in tt_content where to add configuration to add a classand data-role.
For the TABLE content element you have at least 2 options:
A. Render the table yourself - You can create your own PHP method that would do the processing of the tables. I presume you are using css_styled_content extension whose method render_table() does the rendering of the tables. You can copy that method, add it to your own class and modify it so that it adds the data-role attribute as you want.
B. Do some replacing of the outputted code - You can try to use the replacement property (available in TYPO3 >=4.6) of the stdWrap to replace class="contenttable with data-role="table" class="ui-responsive. I currently cannot test it but try this:
tt_content.table.20.stdWrap.replacement {
10 {
search = class="contenttable
replace = data-role="table" class="ui-responsive
}
}
There's a bug report open at forge to override the Flexform values via TSconfig TYPO3 forge.
The suggested workaround by overriding the flexform completly works fine though:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('*', 'FILE:EXT:'.$_EXTKEY.'/flexform_table.xml', 'table');

jQuery UI sortable with fixed rows

I'm using a jQuery UI sortable with a table (works fine). I would like to make the header and last row fixed (non-moveable).
The jQuery UI docs indicate this can be done using a selector for items, but I am at a loss for the syntax.
Here is the relevant code:
<script type="text/javascript">
$(function () {
$("#response_options tbody.content").sortable();
$("#response_options tbody.content").disableSelection();
});
</script>
<table id="response_options" class="data-table">
<tbody class="content">
<tr>
<th>Links</th><th>Response</th>
</tr>
<tr class="sortable-row">
<td>Edit</td>
<td>Item 1</td>
</tr>
<tr class="sortable-row">
<td>Edit</td>
<td>Item 2</td>
</tr>
<tr class="sortable-row">
<td>Edit</td>
<td>Item 3</td>
</tr>
<tr class="sortable-row">
<td>Edit</td>
<td>Item 4</td>
</tr>
<tr class="sortable-row">
<td>Edit</td>
<td>Item 5</td>
</tr>
<tr>
<td>Edit</td>
<td>Item 1</td>
</tr>
</tbody>
</table>
The selector goes inside .sortable(...):
$("#response_options tbody.content").sortable();
as
$("#response_options tbody.content").sortable( items: ??? );
and it should be possible to select only items with class="sortable-row"; but again, I am at a loss for the syntax.
This should work:
$("#response_options tbody.content").sortable({items: 'tr.sortable-row'});
This worked for me:
jQuery(".sortable tbody").sortable({
items: 'tr:not(:first)'
});
For this markup:
<table id="tableid">
<thead>
<tr>
<th>namr</th>
<th>id</th>
</tr>
</thead>
<tbody>
<tr>
<td>jagadeesh</td>
<td>1</td>
</tr>
<tr>
<td>jagadeesh</td>
<td>2</td>
</tr>
</tbody>
</table>
Use this jQuery:
$('#tableid tbody').sortable();
It will move only body content of table you cannot move header part.

Resources