我的 angular 2 应用程序中有一个组件,它有一个下拉列表和一个数据表。根据从下拉列表中选择的名称,我想在数据表中显示详细信息。
HTML -
<div>
<select [(ngModel)]="selectedName">
<option *ngFor="let name of nameList" value= {{name.firstName}} >
{{name.firstName}}
</option>
</select>
<button id="submitName" (click)="getData()">Go</button>
</div>
<table #myTable [dtTrigger]="dtTrigger" datatable class="row-border hover">
<thead>
<tr>
<th>ID</th>
<th>First name</th>
<th>Last Name</th>
<th>Middle Name</th>
</tr>
</thead>
<tbody *ngIf="retrievedNames">
<tr *ngFor="let name of retrievedNames">
<td>{{name.id}}</td>
<td>{{name.firstName}}</td>
<td>{{name.lastName}}</td>
<td>{{name.middleName}}</td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
我的组件.ts
import { Component, OnInit } from '@angular/core';
import { Http } from '@angular/http';
import { NetworkService } from './../services/network.service';
import { Subject } from …Run Code Online (Sandbox Code Playgroud) 说明:在执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。
异常详细信息:System.Data.SqlClient.SqlException:必须声明标量变量“@LocationID”。
源错误:
第 43 行:第 44 行:conn.Open();第 45 行:
adapter.Fill(dt); 第 46 行:conn.Close(); 第 47 行:源文件:C:\Users\Dev D\Documents\Visual Studio 2015\Projects\MySafar\MySafar\Models\DBUtility.cs 行:45
Location.cs(模型类)
public class Location
{
public int LocationID;
public string LocationName;
public string PhotoPath;
public string Details;
public string CityID;
}
public int Update()
{
string query = "UPDATE Location SET LocationName = @LocationName, PhotoPath = @PhotoPath, Details = @Details, CityID = @CityID WHERE LocationID = @LocationID";
List<SqlParameter> parameters = new List<SqlParameter>();
parameters.Add(new SqlParameter("@LocationID", this.LocationID));
parameters.Add(new …Run Code Online (Sandbox Code Playgroud) 我收到此错误:
未捕获的类型错误:无法设置未定义的属性“_DT_CellIndex”
我在网上搜了一下,发现通常是th的计数与td的计数不匹配时发生。
但我不认为这是造成问题的原因。见下表定义:
$(document).ready(function() {
$('#chat').DataTable({
responsive: true,
"bLengthChange": false,
});
} );Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="//cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<link href="//cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css" rel="stylesheet"/>
<table class="table table-striped table-bordered" id="chat">
<thead>
<tr>
<th>From</th>
<th>To</th>
<th>Message</th>
<th>Time of Messgae</th>
</tr>
</thead>
<tbody>
<tr>
<td>jhon</td>
<td>rylie</td>
<td>
<message xmlns:cli="jabber:client" to="rylie__umobilityptt.7600556046@ptt.fms.bizrtc" cli:subject="TEXT MESSAGE" cli:lang="en" type="chat" id="jhon_1523607791051" from="jhon__umobilityptt.7600556046@ptt.fms.bizrtc/bizRTC">
<body>Hey Rylie</body>
<request xmlns="urn:xmpp:receipts"></request>
</message>
</td>
<td>13-04-18 08:23:11</td>
</tr>
<tr>
</tr>
<tr>
<td>rylie</td>
<td>jhon</td>
<td>
<message xmlns:cli="jabber:client" to="jhon__umobilityptt.7600556046@ptt.fms.bizrtc" cli:subject="TEXT MESSAGE" cli:lang="en" type="chat" id="rylie_1523607808352" from="rylie__umobilityptt.7600556046@ptt.fms.bizrtc/bizRTC">
<body>Hey Jhon</body>
<request xmlns="urn:xmpp:receipts"></request>
</message>
</td> …Run Code Online (Sandbox Code Playgroud)我正在使用包含数据表的 R markdown 生成报告。我希望生成的 html 保留一些边距,而不是表格填充页面的整个宽度。
我试过包括:
knitr::opts_chunk$set(fig.width=5, fig.height=8)
Run Code Online (Sandbox Code Playgroud)
我试过这个:
``` {r fig1, fig.height = 3, fig.width = 5, echo = FALSE, include=TRUE}
Run Code Online (Sandbox Code Playgroud)
我试过在输出下的标题中定义图形大小。我在数据表本身中使用了列宽选项。
有什么建议?
这是一个示例 Rmd:
---
title: "Initial Data Check Report"
date: "`r format(Sys.time(), '%B %d, %Y %H:%M:%S', 'America/Chicago', T)`"
output:
html_document:
self_contained: yes
theme: null
highlight: null
mathjax: null
params:
client: "ClientName"
---
### Audit Table
Some text here
---
```{r table, echo = FALSE, include=FALSE}
library(dplyr)
library(DT)
data = mtcars
```
``` {r fig1, fig.height = …Run Code Online (Sandbox Code Playgroud) 如何从 VB.NET 中的输入数据表(已填充)更改数据列的数据类型,然后我会将代码放在 Blue Prism Code Stage 中输入:
我要更改数据类型的字段(列)的名称
我要转换的数据类型
输入集合(数据表)
例子:
Dim InputDT As New DataTable
InputDT.Columns.Add(New DataColumn("test"))
dt.Columns("test").DataType = GetType(Date)
Run Code Online (Sandbox Code Playgroud)
谢谢
我正在使用带有扩展槽的VuetifyJS/VueJS 数据表。如何使扩展槽中的内容可搜索?我尝试将内容包装在其中,但这没有用。<td></td>
这是一个代码笔示例:https://codepen.io/anon/pen/VBemRK?&editors=101
如果您搜索“找到我”,它总是会导致一个Your search for "find me" found no results.
<v-data-table
:headers="headers"
:items="desserts"
:search="search"
item-key="name"
>
<template slot="items" slot-scope="props">
<tr @click="props.expanded = !props.expanded">
<td>{{ props.item.name }}</td>
<td class="text-xs-right">{{ props.item.calories }}</td>
<td class="text-xs-right">{{ props.item.fat }}</td>
<td class="text-xs-right">{{ props.item.carbs }}</td>
<td class="text-xs-right">{{ props.item.protein }}</td>
<td class="text-xs-right">{{ props.item.iron }}</td>
</template>
<template slot="expand" slot-scope="props">
<v-card flat>
<v-card-text><td>Peek-a-boo! Please find me too.</td></v-card-text>
</v-card>
</template>
<v-alert slot="no-results" :value="true" color="error" icon="warning">
Your search for "{{ search }}" found no …Run Code Online (Sandbox Code Playgroud) 我1.10.19在 vue js 中使用数据表。在这里,我有一个动态表格,点击某个按钮,它过滤并用新数据替换表格到表格的 tr 标签。如何用新内容刷新表格?我用过clear,destroy但没有任何效果。这是我的整个代码。
因此,如果列为空或为空,我尝试过滤掉一些行。
我怎么做?
看起来我需要某种类似 SQL 的语句。
我想要这样的东西:
t.DefaultView.RowFilter = string.Format("[disabilities] IS NOT NULL OR EMPTY");
Run Code Online (Sandbox Code Playgroud) 我有一个关于在 PowerShell 中使用 Linq 的问题。我不知道如何正确使用该Except方法
示例表:
$Arr = 1..1000
$Props = ("employeeID","FindName1","FindName2")
$Table1 = New-Object System.Data.DataTable "Table1"
$Props | ForEach-Object { $Table1.Columns.Add( $_ , [String]) | Out-Null }
ForEach ($Record in $Arr ) {
$Row = $Table1.NewRow()
$Row.employeeID = $Record.ToString("00000")
$Row.FindName1 = "UserName_" + $Record.ToString()
$Row.FindName2 = "String_" + $Record.ToString("00000000")
$Table1.Rows.Add($Row)
}
$Arr2 = 980..1111
$Props = ("employeeID","FindName1")
$Table2 = New-Object System.Data.DataTable "Table2"
$Props | ForEach-Object { $Table2.Columns.Add( $_ , [String]) | Out-Null }
ForEach ($Record in $Arr2 …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用此框架添加总计行,但似乎没有考虑过。我发现的唯一方法是这样做,但方法不正确......
<v-data-table
:headers="headers"
:items="desserts"
:items-per-page="5"
class="elevation-1"
>
<template slot="footer">
<tr>
<th></th>
<th>150</th>
<th>260</th>
<th>150</th>
<th>260</th>
<th></th>
</tr>
</template>
</v-data-table>
Run Code Online (Sandbox Code Playgroud)
查看此代码笔以查看结果:
https://codepen.io/slayerbleast/pen/KKKjWjP
页脚就像另一个表格,而不是重复使用相同的列。
知道如何解决这个问题吗?
datatable ×10
datatables ×3
javascript ×3
vue.js ×3
c# ×2
vuetify.js ×2
.net ×1
angular ×1
blueprism ×1
css ×1
jquery ×1
linq ×1
powershell ×1
r ×1
resize ×1
vb.net ×1
winforms ×1