javascript - 角容器尺寸
问题描述
在我的应用程序中,我有一个包含多个容器的表。一个容器(产品名称)需要比其他两个更大的空间,所以我想让它更长,我希望另一个更短。(类别和库存整合代码)。我正在使用angular material
. 如何调整字段大小以使其看起来像我想要的那样?
HTML:
<ng-container matColumnDef="ProductCategory">
<th mat-header-cell *matHeaderCellDef> Category </th>
<td mat-cell *matCellDef="let row; let i = index">
<span *ngIf="EditIndex != i">{{row.ProductCategory?.CategoryName}}</span>
<mat-form-field *ngIf="EditIndex == i" class="w-100-p">
<mat-select required name="ProductCategory" [(ngModel)]="row.ProductCategory"
(selectionChange)="productCategoryChange(row, $event.value.ProductCategoryId, i)">
<mat-option *ngFor="let prm of productCategories" [value]="prm">
{{prm.CategoryName}}
</mat-option>
</mat-select>
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="Product">
<th mat-header-cell *matHeaderCellDef> Product Name</th>
<td *matCellDef="let row; let i = index">
<span *ngIf="EditIndex != i">{{row.Product?.ProductName}}</span>
<mat-form-field *ngIf="EditIndex == i" class="w-100-p">
<input type="text" required matInput name="Product" style="min-width: 400px !important;"
(input)="onSearchChange($event.target.value, row.ProductCategory?.ProductCategoryId)"
[value]="row.Product?.ProductName" [(ngModel)]="row.ProductId"
(ngModelChange)="updateWorkItemProductName($event, row)"
[matAutocomplete]="autoProduct">
<mat-autocomplete autoActiveFirstOption #autoProduct="matAutocomplete"
[displayWith]="displayProduct.bind(this)">
<mat-option *ngFor="let prm of products" [value]="prm.ProductId"
style="font-size: smaller;">
{{prm.ProductName}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="StockIntegrationCode">
<th mat-header-cell *matHeaderCellDef> Stock Integration Code </th>
<td *matCellDef="let row; let i = index">
<span *ngIf="EditIndex != i">{{row.Product?.StockIntegrationCode}}</span>
<mat-form-field floatLabel="never" *ngIf="EditIndex == i" class="w-100-p">
<input matInput name="StockIntegrationCode"
[(ngModel)]="row.Product.StockIntegrationCode"
(blur)="filterProductByStockIntegrationCode($event.target.value, row)">
</mat-form-field>
</td>
</ng-container>
解决方案
推荐阅读
- typescript - 检查打字稿中的深点符号路径
- java - 将 WAV 文件读入 Java,获得与 MATLAB 或 SciPy 相同的值
- javascript - 登录安全 Javascript
- python - 按流派 Spotify API 获取前 100 位艺术家
- python - 如果是,Python数据框会在特定字符之前删除子字符串
- html - 为什么使用跨度时一个元素的上边距会影响另一个元素?
- mysql - 无法使用 MySQL 命令行客户端和用于 python 的 mysql 连接器连接到 MySQL 服务器
- javascript - 浏览器显示 Uncaught SyntaxError: Unexpected token ':'?
- javascript - Trouble with React: Making component equal to the result of a function
- kubernetes - 如何更改 RKE 中的 kubelet 选项,例如 Rancher 中的 eviction-hard(nodefs.available、imagefs.available 等)?