Angular Data tables multiple row section headers - sorting

I have a table that is already listed in ascending desired order with two distinct sections and I want to add headers for each section but I'm not quite sure how to do so. I am using the directive Angular datatables and would like to have the end result have row titles like the "Status:New" and "Status:Open" in the example image below.

After much research, currently there is no supported way to fix rows in the middle of the specific table I'm working with.

Add something like this after your initial code for your table. Assuming you're using 2 tables.
var table1 = $("#your_top_table").DataTable({});
$(table.table().header()).append('<tr><td>Status: New</td></tr>');
var table2 = $("#your_bottom_table").DataTable({});
$(table2.table().header()).append('<tr><td>Status: Open</td></tr>');

Related

Additional row with empty header in matrix in power bi

The problem is probably trivial but unfortunately I can't figure it out. Here are two basics tables:
I tried to create the matrix based on the selected ID (from the Table2) with values from Table1. I created a measure "% Margin" (margin divided by revenue) and tried to add this to the matrix with ID from Table2. Every time besides ID from Table2 I got one additional row with empty ID. Anyone has an idea how to get rid it off? The rest of the matrix is correct.
Instead of using a separate static table, simply add a new column to you table and use that to filter your data for the report.
Here's how this would look like:

Sorting Issue After Table Render in Laravel DataTables as a Service Implementation

I have implemented laravel dataTable as a service.
The initial two columns are actual id and names so, I am able to sort it asc/desc after the table renders.
But the next few columns renders after performing few calculations, i.e. these values are not fetched directly from any column rather it is processed.
I am unable to sort these columns where calculations were performed, and I get this error. And I know it is looking for that particular column for eg outstanding_amount which I don't have in the DB, rather it is a calculated amount from two or more columns that are in some other tables.
Any Suggestions on how to overcome this issue?
It looks like you're trying to sort by values that aren't columns, but calculated values.
So the main issue here is to give Eloquent/MySql the data it needs to provide the sorting.
// You might need to do some joins first
->addSelect(DB::raw('your_calc as outstanding_amount'))
->orderBy('outstanding_amount') // asc can be omitted as this is the default
// Anternative: you don't need the value sorted by
// Don't forget any joins you might need
->orderByRaw('your_calc_for_outstanding_amount ASC')
For SQL functions it'll work as follow
->addSelect(DB::raw('COUNT(products.id) as product_count'));
->orderByRaw(DB::raw('COUNT(products.id)'),'DESC');

Datameer - Add Columns to Joined table

I have joined some data from HDFS with some data from an Oracle DW, which is working fine, but I cant seem to add any new columns to this sheet. To add columns for calculated fields etc I have to duplicate the sheet and do it there - this doesn't seem overly efficient.
Am I doing something wrong here or can you not add columns to a join result sheet?
... but I cant seem to add any new columns to this sheet.
Right. It will not be possible to add columns to a JoinedSheet. It is a new data set containing columns from two or more sheets based on a key column which you defined.
... or can you not add columns to a join result sheet?
It will be necessary to reference these data as input for a new Worksheet by Duplicating Worksheet.
Another approach could be using datameer rest-api. You can get the content of the workbook in json format and add columns manually or by implementing a simple script, then update the workbook with changed json file.

datatables + adding a filter per column

How do I get the search/filter to work per column?
I am making small steps in building, and constantly adding to my data table, which is pretty dynamic at this stage. It basically builds a datatable based on the dat that is fed into it. I have now added the footer to act as a search/filter, but unfortunately this is where I have become stuck. I cannot get the filer part to work. Advice greatly appreciated.
here is my sample data tables that I am working on http://live.datatables.net/qociwesi/2/edit
It basically has dTableControl object that builds by table.
To build my table I need to call loadDataFromSocket which does the following:
//then I have this function for loading my data and creating my tables
//file is an array of objects
//formatFunc is a function that formats the data in the data table, and is stored in options for passing to the dTableControl for formatting the datatable - not using this in this example
//ch gets the keys from file[0] which will be the channel headers
//then I add the headers
//then I add the footers
//then I create the table
//then i build the rows using the correct values from file
//then I draw and this then draws all the row that were built
//now the tricky part of applying the search to each columns
So i have got this far but the search per column is not working. How do I get the search/filter to wrok per column?
Note this is a very basic working example that I have been working off: http://jsfiddle.net/HattrickNZ/t12w3a65/
You should use t1.oTable to access DataTables API, see updated example for demonstration.
Please compare your code with jsFiddle in your question, notice its simplicity and consider rewriting your code.

Magento - Mageworx Extended Orders - rearrange columns

I have more or less inherited a Magento site, which seems to be using the Mageworx Extended Orders extension for the order grid in the admin area.
Client would like the columns to be rearranged, eg, move Email over beside Voucher. In the System Config you can select columns but there doesn't seem to be any way of ordering them. I have searched through the code and tried editing code\local\MageWorx\Adminhtml\Block\Orderspro\Sales\Order\Grid.php to no avail.
I also looked in the database but couldn't find a table which might have the columns selected so that I could order them.
Thanks.
As it happens it was that file, MageWorx\Adminhtml\Block\Orderspro\Sales\Order\Grid.php, that I needed to edit. I took out the loop and just commented out the fields I didn't want showing and put the rest in the required order
You can change it in the file: app/code/local/MageWorx/OrdersPro/Block/Adminhtml/Sales/Order/Grid.php in the _prepareColumns() method.
At the moment changing columns order is quite a challenge and can be done only this way:
$listColumns = $helper->getGridColumns();
$listColumnsChanged = $listColumns; // create a copy of $listColumns
$listColumnsChanged[0] = $listColumns[3];
$listColumnsChanged[3] = $listColumns[0]; // interchange the columns that have id 3 and 0
var_dump($listColumns); // var_dump will let you learn ID of the column you need
foreach ($listColumnsChanged as $column) { // change foreach for getting to $listColumnsChanged

Resources