emberjs - nested tables info - ember.js

I have an irregular table structure I would like to nest (either using actual tables or using div tables). I have a list of 'Parent' classes, each of which has many 'Children' instances, and I want to show them in the same table, with a single set of headers. I would like the output to be something like this (simplified - I have many more columns to display).
<table>
<tr>
<th>Parent</th>
<th>Child</th>
<th>Remove</th>
</tr>
<tr>
<td colspan="2">parent one</td>
<td>child one</td>
</tr>
<tr>
<td>child two</td>
</tr>
</table>
But I can't figure out how to accomplish this in handlebars because of the fact that I need to have a new <tr> element around every child except for the first one. This is easy enough to figure out in code, but I can't see how to do it cleanly in handlebars. Is it possible or should I write a custom view?

Related

Cloud data fusion Parameterized pipeline using argument setter and wrangler

Is there a way to create reusable data fusion pipeline that can handle multiple table transformations.
Example: I have 2 tables in BigQuery dataset in raw format and I would like to create data fusion pipeline and load transformed data in another BigQuery dataset say:
Table 1:
<table>
<thead>
<tr>
<th>ID</th>
<th>first_name</th>
<th>last_name</th>
<th>age</th>
<th>address</th>
<th>salary</th>
</tr>
</thead>
<tbody>
<tr>
<td>e111</td>
<td>Amy</td>
<td>Fowler</td>
<td>34</td>
<td>123 Stevens Ave, Dallas, TX, 75252</td>
<td>105,000</td>
</tr>
<tr>
<td>e222</td>
<td>Leonard</td>
<td>Hoffstadar</td>
<td>32</td>
<td>Apt 213 Stamford Village, Stamford, CT, USA2</td>
<td>70,000</td>
</tr>
</tbody>
</table>
Table 2:
<table>
<thead>
<tr>
<th>Dept_id</th>
<th>Dept_name</th>
<th>Supervisor</th>
</tr>
</thead>
<tbody>
<tr>
<td>d123</td>
<td>abc</td>
<td>Amy</td>
</tr>
<tr>
<td>d234</td>
<td>xyz</td>
<td>John</td>
</tr>
</tbody>
</table>
Task:
Read table 1 and table 2 from Bigquery Raw Dataset
Apply transformation:
a). Concatenate first_name and last_name in table 1 to create another column with full name.
b). Uppercase dept_name in table 2
Load this transformed data to BigQuery Curated dataset
Now, I would like to create single reusable pipeline that could do the above job by maybe be passing table and field names as argument and the whole process is required to be automated without human input required.
Bigquery argument setter could be used, but I'd like to know if it is possible and how to apply separate transformations to individual tables in single pipeline. Does wrangler support this?

On back orders, how do I get only items that have a remaining quantity to print on the Advanced PDF?

I created a new Advanced PDF/HTML for back orders that have some items that have shipped, and some items still open with a future ship date. When I print the pdf, it shows the items that have already shipped as a quantity of zero. How do I tell the system to only print line items that have a quantity greater than zero?
<#if record.item?has_content>
<table class="classic-table" style="width: 100%; margin-top:10px;"><!-- start items --><#list record.item as lineItem><#if lineItem_index==0><tr>
<th class="column-sub-title" colspan="5">Item Code</th>
<th class="column-sub-title" colspan="7">${lineItem.item#label}</th>
<th class="column-sub-title" colspan="6">${lineItem.description#label}</th>
<th class="column-sub-title" colspan="4">Quantity</th>
<th class="column-sub-title" colspan="3">${lineItem.rate#label}</th>
<th class="column-sub-title" colspan="3">${lineItem.amount#label}</th>
</tr></#if>
<tr>
<td class="column-data" colspan="5">${lineItem.custcol_htd_item_id}</td>
<td class="column-data" colspan="7">${lineItem.item}</td>
<td class="column-data" colspan="6">${lineItem.description}</td>
<td class="column-data" colspan="4">${lineItem.custcol_htd_quantity_remaining}</td>
<td class="column-data" colspan="3">${lineItem.custcol_unbilled_unit_price}</td>
<td class="column-data" colspan="3">${lineItem.custcol_htd_dollar_amt_remaining}</td>
</tr>
</#list><!-- end items -->```
You can use the Picking Ticket on Sales Orders for that.
Another way is to add an if statement like the following:
https://freemarker.apache.org/docs/ref_directive_if.html
<#if lineItem.custcol_htd_quantity_remaining>0>
<tr>
<td class="column-data" colspan="5">${lineItem.custcol_htd_item_id}</td>
<td class="column-data" colspan="7">${lineItem.item}</td>
<td class="column-data" colspan="6">${lineItem.description}</td>
<td class="column-data" colspan="4">${lineItem.custcol_htd_quantity_remaining}</td>
<td class="column-data" colspan="3">${lineItem.custcol_unbilled_unit_price}</td>
<td class="column-data" colspan="3">${lineItem.custcol_htd_dollar_amt_remaining}</td>
</tr>
</#if>
Thanks Gustavo, that pretty much worked except instead of using the greater than ">" symbol, I used "gt" and that did the trick.
The other thing I had to change was my custom body field "htd_quantity_remaining" to identify as an integer, I originally had it saved as free-form text which wouldn't work in that formula.
If anyone else is have problems with printing accurate information for back orders, i.e. subtotal and total of dollar amount still open on the order vs. the original dollar amount of the SO, I was finally able to work through a solution.
First, you'll need to create a saved search to total up the subtotal of all invoices related to that sales order. In our industry, some sales orders will have 3-4 invoices related to it. GO TO:
Hover over reports, select "new search"
Criteria tab, filter sub menu select:
Type: is invoice
Main Line: is True (yes)
Results tab select:
Document Number
Subtotal amount w/ summary type as "sum"
Available Filters tab select:
Created From: Internal ID w/ "show in filter region" selected (yes)
Use that saved search to create a custom body field labeled as "Amount Billed To-Date (subtotal)"
Create another custom body field labeled "Amount Unbilled (subtotal)" and under the Validating and Default tab, select formula. Set formula to: Subtotal - amount billed to-date
Use the custom body field "Amount Unbilled (subtotal)" as the new subtotal on the advanced pdf/html for any back orders. I created an entire new sales order form for back orders, but I'm sure there is a way to include this info on the default Sales Order pdf by using an IF-ELSE formula.
These instructions assume you somewhat know how to work with Netsuite coding, if you need further explanation let me know.

{{#link-to}} helper not working with supplied model

I have the following index template:
<table class="table table-striped table-condensed table-hover">
<thead>
<tr>
<th>name</th>
</tr>
</thead>
<tbody>
{{#each agent in model}}
<tr>
<td>{{#link-to "agents.show" agent}}{{agent.name}}{{/link-to}}</td>
</tr>
{{/each}}
</tbody>
</table>
I have defined a link-to to a show route, but this is not working: it is creating the following link:
http://localhost:9001/#/nodes/agents/undefined/show
With an undefined dynamic segment. If instead I directly supply the .id of the agent:
<td>{{#link-to "agents.show" agent.id}}{{agent.name}}{{/link-to}}</td>
The link is created fine. But I do not want to do this because that means a round-trip to the server, while I already have the model available in the index controller. Besides, the link-to helper has always worked fine with a supplied model (I have refactored my app quite a bit, and I am unable to find the source of this problem)
Why is link-to able to use the object id for the dynamic segment, but it is not able to pass the full object to the linked route? What can I do to further debug this issue?

Display ColdFusion Query Output in a Formatted Table

Let me begin by saying that I'm a novice at ColdFusion and trying to learn so please bear with me.
I work in an apartment complex that caters to students from the local college. We have one, two and four bedroom apartments. Each room in an apartment is leased to an individual student. What I want to do is populate an HTML table with all the people in a room. My query is working and pulling all the relevant data but what is happening is that each person is being split out to their own HTML table instead of all the people in a room being put into the same table. Here is an example:
What I want
What is happening:
Here is my code:
<!---Begin data table--->
<cfoutput query = "qryGetAssignments">
<div class="datagrid">
<table>
<tr><td align="right"><strong>#RoomType#</strong></td></tr>
<thead>
<tr>
<th>#RoomNumber#</th>
</thead>
<tbody>
<tr><td><strong>#Bed#</strong>
| #FirstName# #LastName# :: #StudentNumber#
</td>
</tr>
</tbody>
</table>
</div>
</cfoutput>
I know why the output is coming out like it is, I just don't know how to fix it. I want there to be four residents in one table for a four bedroom apartment, two residents in a table for a two bedroom, and so on. Thanks in advance for your help.
Edit:
Sorry about the confusion. Here is a full pic of what I'm going for:
This should do what you need, assuming your query is properly ordered by roomType, for the <cfoutput group=""> to work.
<!---Begin data table--->
<cfoutput query="qryGetAssignments" group="roomType">
<div class="datagrid"><!--- If this isn't needed to style the tables, it can be moved outside the loop --->
<table>
<tr><td align="right"><strong>#qryGetAssignments.roomType#</strong></td></tr>
<thead>
<tr>
<th>#qryGetAssignments.roomNumber#</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<strong>#qryGetAssignments.bed#</strong>
<cfoutput><!--- this output here will loop over rows for that groupby --->
| #FirstName# #LastName# :: #StudentNumber#
</cfoutput>
</td>
</tr>
</tbody>
</table>
</div>
</cfoutput>
I've also scoped your query variables, at least I believe they are variables from a query.
That should work except it might need to be grouped by "roomNumber" such as N108.

django and dataTables - speed up query and page display

I have a page in my app that lists all our client records - about a thousand total. The query is straight forward (two queries, actually) and look like this (one for commercial and one for residential):
all_comm = System.objects.all().filter(isRessy=False)
all_ressy = System.objects.all().filter(isRessy=True)
In my template, I simply iterate over both queries displaying the information in a table. This code looks like this:
<table style="width:100%;" class="field_container dt full-border">
<thead>
<tr>
<th align=left width=200>Owner</th>
<th align=center width=100>System ID</th>
<th align=left>System Address</th>
<th align=center width=200>Options</th>
</tr>
</thead>
<tbody>
{% for System in all_ressy %}
<tr onclick="window.location.href='{% url cpm.systems.views.system_overview System.systemID %}'">
<td>{{ System.billingContact.lastName }}, {{ System.billingContact.firstName }}</td>
<td align=center>{{ System.pk }}</td>
<td>{{ System.systemAddress }}, {{ System.systemCity }}</td>
<td align=center>
Create Service Call
</td>
</tr>
{% endfor %}
</tbody>
</table>
This code is identical for showing all the commercial records. If you'll notice that I have a class of dt listed in the table. That sets the table to be a dataTable table. As such, the rows get nice highlighting, the columns can be sorted, and there's a search box at the top of the table. All nice stuff.
The problem is that the page, as a whole, is a bit slow to load. It seems that half of the loading time is the raw displaying of data (fetching data then iterating over all the records generating the basic HTML table). The second half of the loading time (or at least a decent chunk of the time) looks to be devoted to converting the regular table into a dataTable.
I'm wondering if there's anything I can do to speed this whole process up. I've tried using pagination on the dataTable but that seems to be useless since all the records are loaded anyway, just hidden across multiple dataTable pages. Real pagination for the whole page isn't really possible given the nature of the app. I feel like the queries aren't going to get any faster so there's got to be optimization or some trick to make this page load faster.
Any thoughts?
Thanks for the help
Edit I'm referring to this dataTable plugin: http://datatables.net/index
You could try using ajax to load the data directly into the DataTable It would remove the HTML rendering step.
http://datatables.net/release-datatables/examples/ajax/objects.html (I assume this is the datatables you are talking about...)