AngularJS Error - forms

I got this error in inspector:
Error: [ngRepeat:dupes] http://errors.angularjs.org/1.2.9/ngRepeat/dupes?p0=subject%20in%20subjects&p1=string%3A%D0%90%D1%81%D1%82%D1%80%D0%BE%D0%BD%D0%BE%D0%BC%D0%B8%D1%8F
at Error (<anonymous>)
at http://vedomosti/js/angular.min.js:6:449
at http://vedomosti/js/angular.min.js:184:445
at Object.fn (http://vedomosti/js/angular.min.js:99:371)
at h.$digest (http://vedomosti/js/angular.min.js:100:299)
at h.$apply (http://vedomosti/js/angular.min.js:103:100)
at f (http://vedomosti/js/angular.min.js:67:98)
at E (http://vedomosti/js/angular.min.js:71:85)
at XMLHttpRequest.v.onreadystatechange (http://vedomosti/js/angular.min.js:72:133) angular.min.js:84
But I don't understand where my mistake...
I'm writing an application for school. I have table school in MySQL.
With fields:
id, name, 1,2,3,4,5,6,7,8,9,10,11
1,2,3,4... it's classes and they are have information about subjects. Each class have their subjects. Now I'm writing part, in which user can set subjects into classes. 1 to 10 classes all works good. But when I click "load subjects from 11 class", I get this error.
This table with subjects:
div class="large-6 column">
<label>Предметы {{class}} класса</label>
<table>
<thead>
<tr>
<th style="width: 200px;">Предмет</th>
<th style="width: 200px;">Изменить</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="subject in subjects">
<td>{{subject}}</td>
<td><a>изменить</a></td>
</tr>
</tbody>
</table>
</div>
And button for load information other classes:
<button class="button success tiny" ng-click="getSCLASS()">получить</button>
And function for this button:
$scope.getSCLASS = function(){
$http.post("/index.php/panel/getSCLASS", {class:$scope.class}).success(function(data){
$scope.subjects = data;
$scope.s_subjects = true;
});
}
From 1 to 10 classes - all works good. But with 11 class it's not work. I don't understand where my mistake.
Sorry for my English :|

See this and try this:
<div class="large-6 column">
<label>Предметы {{class}} класса</label>
<table>
<thead>
<tr>
<th style="width: 200px;">Предмет</th>
<th style="width: 200px;">Изменить</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="subject in subjects track by $index">
<td>{{subject}}</td>
<td><a>изменить</a></td>
</tr>
</tbody>
</table>
</div>

Related

Is it possible to generate custom configuration of table using tinymce?

A table of two raw by tinymce:
<table style="width: 100%;" border="1">
<tbody>
<tr>
<td style="width: 33.3333%;"></td>
<td style="width: 33.3333%;"></td>
<td style="width: 33.3333%;"></td>
</tr>
<tr>
<td style="width: 33.3333%;"></td>
<td style="width: 33.3333%;"></td>
<td style="width: 33.3333%;"></td>
</tr>
</tbody>
</table>
I can add new class and attributes and reform this default table structure. But is it possible to add etc? for example I want to generate the following bootstrap table:
<table style="width: 100%;" class="table table-bordered">
<thead>
<tr>
<th style="width: 33.3333%;"></th>
<th style="width: 33.3333%;"></th>
<th style="width: 33.3333%;"></th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 33.3333%;"></td>
<td style="width: 33.3333%;"></td>
<td style="width: 33.3333%;"></td>
</tr>
</tbody>
</table>
I can add this class 'table table-bordered'. I can't add <thead>,<th>. I read the documentation of tinymce and googling for 2 days. Know I have come to a conclusion - I will stop if it is actually not possible. Any help is appreciated. Thanks for your time.

Magento order email missing style

I have a question regarding the magento order emails.
I have created my own order template by loading the default template and modifying it. When i take a look via the 'preview template' button on there, the email appears without order information (of course) but with every styling etc.
However when my customer gets the email it is pure text with no styling at all.
What could i have been doing wrong
Idk if it helps but here is my email template:
{{template config_path="design/email/header"}}
{{inlinecss file="email-inline.css"}}
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style='background: #fff' class="email-heading">
<h1 style='color: #68883e;'>Thank you for your order</h1>
<p>Your order is being process right now</p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="order-details">
<h3 style='display: inline; float: left'>Your order <span class="no-link">#{{var order.increment_id}}</span></h3>
<p style='display: inline; float: right'>Placed on {{var order.getCreatedAtFormated('long')}}</p>
</td>
</tr>
<tr class="order-information">
<td>
{{if order.getEmailCustomerNote()}}
<table cellspacing="0" cellpadding="0" class="message-container">
<tr>
<td>{{var order.getEmailCustomerNote()}}</td>
</tr>
</table>
{{/if}}
{{layout handle="sales_email_order_items" order=$order}}
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="address-details">
<h6>Bill to:</h6>
<p><span class="no-link">{{var order.getBillingAddress().format('html')}}</span></p>
</td>
<td class="address-details">
<h6>Client:</h6>
<p><span class="no-link">{{var order.getclientfirstname().format('html')}}</span></p>
</td>
</tr>
<tr>
{{depend order.getIsNotVirtual()}}
<td class="method-info">
<h6>Shipping method:</h6>
<p>{{var order.shipping_description}}</p>
</td>
{{/depend}}
<td class="method-info">
<h6>Payment method:</h6>
{{var payment_html}}
</td>
</tr>
</table>
</td>
</tr>
</table><!-- asd-->
{{layout handle="sales_email_order_items" order=$order}}
{{template config_path="design/email/footer"}}
You shouldn't use the CSS classes to stylize the templates.
Also, you shouldn't use the file with the styles info, that is located anywhere else, as they are not supported by the majority of the email services.
Instead, you can directly use the attribute tags (to implement the stylazation) or use the styles right in the email code (using the tag <style>)
And here is the list of tags you can use:
https://www.campaignmonitor.com/css/

Using TinyMCE with handlebars template

I am trying to use TinyMCE to allow my users to modify a handlebars report template. The template contains several elements that are not valid to TinyMCE and they are being moved around. See the {{#each data}} and {{/each}}
Here is good HTML code for my handlebars template:
<table class="table table-bordered">
<thead>
<tr>
<th><h4>Item</h4></th>
<th><h4 class="text-right">Quantity</h4></th>
<th><h4 class="text-right">Rate/Price</h4></th>
<th><h4 class="text-right">Sub Total</h4></th>
</tr>
</thead>
<tbody>
{{#each Details}}
<tr>
<td>{{Item}}<br><small>{{Description}}</small></td>
<td class="text-right">{{Quantity}}</td>
<td class="text-right">{{Rate}} {{UnitOfMeasure}}</td>
<td class="text-right">{{Amount}}</td>
</tr>
{{/each}}
</tbody>
</table>
After I past the code into TinyMCE, it results to the following:
{{#each Details}}{{/each}}
<table class="table table-bordered">
<thead>
<tr><th>
<h4>Item</h4>
</th><th>
<h4 class="text-right">Quantity</h4>
</th><th>
<h4 class="text-right">Rate/Price</h4>
</th><th>
<h4 class="text-right">Sub Total</h4>
</th></tr>
</thead>
<tbody>
<tr>
<td>{{Item}}<br /><small>{{Description}}</small></td>
<td class="text-right">{{Quantity}}</td>
<td class="text-right">{{Rate}} {{UnitOfMeasure}}</td>
<td class="text-right">{{Amount}}</td>
</tr>
</tbody>
</table>
Has anyone ran across a plugin or something else that may help me?
I just ran into this... I have an order confirmation email that I need to be configurable with a list of order items in a table; same issue.
I did just realize I probably shouldn't be using tables anyway, since they are not responsive, but I ultimately was able to solve the problem with HTML comments, like this:
<tr style="font-weight: bold;">
<td style="width: 145px;">Qty</td>
<td>Item</td>
<td>Unit Price</td>
<td>Total</td>
</tr>
<!--{{#order.line_items}} -->
<tr repeat="">
<td style="width: 145px;">{{quantity}}</td>
<td>{{product.name}}</td>
<td>{{currency unit_price}}</td>
<td>{{currency total}}</td>
</tr>
<!--{{/order.line_items}} -->
<tr>
<td style="width: 145px;"> </td>
<td> </td>
<td><strong>Subtotal:</strong></td>
<td>{{currency order.subtotal}}</td>
</tr>
I was able to use a custom attribute on my Element and use:
<tr repeat="{{#each Details}}">
</tr repeat="{{/each}}">

How Do I Display Document ID Using Meteor Spacebars?

I am new to Meteor, and I have an app that outputs data into rows of a table, I want to have a column for the ObjectID just for testing purposes, and I will disable this in production, but my handlebars template does not seem to output the _id at all. any ideas are appreciated!
Here is my template:
<template name="Fillup">
{{#each FillupArr}}
<tr class="fillup row">
<td> <div class="btnEdit">edit</div> <div class="btnSave" >save</div></td>
<td class="">{{Fillup_id.toHexString}}</td>
<td class="dateResult">{{Date}}</td>
<td class="mpg">{{MPG}}</td>
<td class="tripResult">{{Trip}}</td>
<td class="ppg">{{PPG}}</td>
<td class="ppm">{{PPM}}</td>
<td class="galResult">{{Gal}}</td>
<td class="priceResult">{{Price}}</td>
<td class="stationResult">{{Station}}</td>
<td> <div class="btnRemove">remove</div> <div class="btnCancel">cancel</div></td>
</tr>
{{/each}}
</template>
I figured it out, you dont need to incude the collection name in the handlebars template so it changed from:
<td class="">{{Fillup_id.toHexString}}</td>
to
<td class="">{{_id}}</td>
and now it works!

sahi and table operations

For a given table, I'd like to get the below
total number of rows
able to iterate over by row and column
using the Java Driver. I tried the option mentioned here with no luck.
Below is the HTML for table
<div id="hawkMessageCodeTable" class="ui-datatable ui-widget">
<table>
<thead>
<tr>
<th id="hawkMessageCodeTable:j_idt49" class="ui-state-default">
<div class="ui-dt-c">
<span>Code</span>
</div>
</th>
<th id="hawkMessageCodeTable:j_idt51" class="ui-state-default">
<div class="ui-dt-c">
<span>Message</span>
</div>
</th>
</tr>
</thead>
<tbody id="hawkMessageCodeTable_data" class="ui-datatable-data ui-widget-content">
<tr data-ri="0" class="ui-widget-content ui-datatable-even">
<td>
<div class="ui-dt-c">
9005
</div>
</td>
<td>
<div class="ui-dt-c">
Initial Fraud Alert on File
</div>
</td>
</tr>
<tr data-ri="1" class="ui-widget-content ui-datatable-odd">
<td>
<div class="ui-dt-c">
9003
</div>
</td>
<td>
<div class="ui-dt-c">
Security Alert or consumer statement on file relates to true name fraud or credit fraud
</div>
</td>
</tr>
<tr data-ri="2" class="ui-widget-content ui-datatable-even">
<td>
<div class="ui-dt-c">
2501
</div>
</td>
<td>
<div class="ui-dt-c">
Input/File (Current/Previous) Address Has Been Used (#) Times In The Last (30,60,90) Days On Different Inquiries
</div>
</td>
</tr>
<tr data-ri="3" class="ui-widget-content ui-datatable-odd">
<td>
<div class="ui-dt-c">
9004
</div>
</td>
<td>
<div class="ui-dt-c">
Active Duty Alert on File
</div>
</td>
</tr>
</tbody>
</table>
</div>
I have implemented a similar function with sahi for ruby. To answer your questions:
rowLen = table.fetch("rows.length").to_i
Loop through all the cells with:
#browser.cell(table,rowIndex,colIndex).exists?()
You can find the corresponding api for sahi java