我有一个数据表,看起来像这样
基本上我希望它是按列featurename(distinct)分组,它应该在努力和完整列中
指定所有featureid,featurename逗号
分配给comman seprated
的featureid的分别计数
我希望datatable看起来像这样
不知道如何使用计数码
var result5= dtTaskandBugs.AsEnumerable().GroupBy(x => x["Functional Area"])
.Select(item => new
{
FunctionalArea = item.Key,
Completedsum = item.Sum(y => Convert.ToDecimal(y["Completed"])),
effortsum = item.Sum(z => Convert.ToDecimal(z["effort"])),
storyids = string.Join(",", item.Select(a => a["Storyid"]).Distinct()),
storiesename= string.Join(",", item.Select(b => b["StoryName"]).Distinct()),
Featureid = string.Join(",", item.Select(c => c["Featureid"]).Distinct()),
Featurename= string.Join(",", item.Select(d => d["FeatureName"]).Distinct()),
});
Run Code Online (Sandbox Code Playgroud) 我有一个包含200多列的数据表,但是,在这些列的一半以上,我的大多数数据行的值都为'NULL'.
那些NULL值会降低我的SQL Server的性能,还是具有NULL值的字段与数据表上的所有操作无关?
我在laravel项目中使用数据表.需要从数据库中获取记录,它可能是两个点.如何使用rowspan或colspan来创建具有分页和pageLength功能的记录类别组?
该项目致力于laravel框架5.5.php> = 7.0版本和MySQL 5.0.
我也尝试过rowGroup的数据表.但它有一些限制,如:
- 目前一次只能使用一个数据点进行分组 - 不支持嵌套分组
- 无法扩展/折叠组的选项
- 不支持Buttons扩展的导出选项 - 只是忽略分组信息.
var table = $('#report-employee-table').DataTable({
pageLength: 20,
processing: true,
serverSide: true,
bLengthChange: false,
dom: 'Blfrtip',
buttons: [{
extend: 'excelHtml5',
"text": '<span class="glyphicons glyphicons-file_export"></span> Export',
"title": 'Employee Report',
"message": 'Employee Name: ' + $('#employee_id option:selected').text() + ' Work Duration: ' + $('#report_date').val(),
"filename": 'employee-report',
header: true,
footer: true,
exportOptions: {
modifier: {
selected: true
}
},
customize: function (xlsx) {
var sheet = xlsx.xl.worksheets['sheet1.xml'];
// …Run Code Online (Sandbox Code Playgroud) 我正在尝试构建一个全宽度DataTable,Flutter左侧有一个固定宽度的列,另外两列应该将剩余的列分开。
但是,即使左侧标题文本被截断,中间列和右侧列也不会占用剩余宽度,如下所示:
当文本太宽而无法在单行中显示时,我还想将文本换行到单元格中,但Wrap无法按预期工作。
我该如何解决我的问题?
这是代码:
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Column(children: [
Expanded(
child: Container(
constraints: BoxConstraints.expand(width: double.infinity),
child: SingleChildScrollView(
child: DataTable(
headingRowHeight: 32,
dataRowHeight: 24,
columns: [
DataColumn(
label: ConstrainedBox(
constraints: BoxConstraints(
maxWidth: 20,
minWidth: 20,
),
child: Text('Short column'),
),
),
DataColumn(label: Text('Long column')),
DataColumn(label: Text('Long column')),
],
rows: [
DataRow(
cells: [ …Run Code Online (Sandbox Code Playgroud) 我正在尝试制作一个可重用的 vuetify 数据表。如果我愿意的话,我希望能够传递动态槽或项目槽,并且两者都应该有效。这是代码
<v-data-table
:headers="headers"
:items="items"
:dense="dense"
:hide-default-header="hideDefaultHeader"
:loading="loading"
:options.sync="settings"
:items-per-page="itemsPerPage"
:server-items-length="itemLength"
@click:row="handleClick"
:height="height"
>
<-- 1st part-->
<template v-for="field in slots" v-slot:[field.field]="{ item }">
<slot :name="field.field" :item="item"></slot>
</template>
<-- 2nd part -->
<template v-slot:item="{item}">
<slot name="item" v-bind="item"></slot>
</template>
</v-data-table>
Run Code Online (Sandbox Code Playgroud)
然后创建一个组件,DataTable然后我像这样使用它
<DataTable
v-if="tabs == n"
:items="items"
:loading="loading"
:headers="headers"
:options="serverOptions"
:slots="slots"
:total="toatl"
@updateOptions="updateOptions($event, n)"
>
Run Code Online (Sandbox Code Playgroud)
我也有一个像这样的插槽数组
slots: [{ field: "item.CREATOR" }, { field: "item.BODY" }]
Run Code Online (Sandbox Code Playgroud)
我希望能够使用item槽位数组2nd part或使用槽位数组中定义的特定列槽位1st part。现在是动态插槽,除非我注释掉2nd part. 这就是我目前对每个部分进行定位的方式
第 …
我有一个 Vue 组件,其中包含 Vuetify v-data-table组件。它使用带有<v-text-field>. 我遇到的问题是,使用filter作为道具传递到数据表的标头中的函数会阻止搜索功能工作。
数据表组件使用body-prepend槽来定义用于过滤表内容的选择列表。
<v-data-table
show-expand
:headers="headers"
:items="items"
:search="search"
item-key="sow"
hide-default-footer
dense
disable-pagination
>
<template v-slot:top>
<v-toolbar flat color="white">
<v-toolbar-title>{{ title }}</v-toolbar-title>
<v-spacer></v-spacer>
<v-text-field
v-model="search"
prepend-icon="search"
label="Search"
single-line
hide-details
clearable
></v-text-field>
</v-toolbar>
</template>
<template v-slot:body.prepend>
<tr>
<td :colspan="7"></td>
<td v-if="showStatusFilter">
<v-select
v-model="selectedStatuses"
:items="statuses"
:menu-props="{ maxHeight: '400' }"
label="Select Status"
multiple
chips
deletable-chips
small-chips
dense
></v-select>
</td>
<td v-if="showPracticeFilter">
<v-select
v-model="selectedPractices"
:items="practices"
label="Select Practice"
multiple
chips
deletable-chips
small-chips
dense
></v-select> …Run Code Online (Sandbox Code Playgroud) 我试图使我的数据表 Thead 成为一个粘性表,但是当我尝试固定标题时它不起作用。我已经尝试position: fixed; , top: 0; 并尝试用 css 修复它,但是当完成此操作时,它会按预期在 firefox 中工作,但在 crome edge opera 中不会按预期工作。
"stateSave": false,
"orderCellsTop": true,
"fixedHeader": {
header: true,
},
"columns": [
{'data':'chk_select_header','orderable': false},
Run Code Online (Sandbox Code Playgroud)
这是我的 ajax 代码。
我正在 flutter 中创建动态数据表视图,其中列标题和行值是动态添加的。数据是一个 Json 响应,标题是一个字符串数组,要在行中显示的数据也是一个字符串数组。目标是在表视图中显示数据,而不需要任何硬编码值。\n这就是我尝试过的方法就是显示数据。
\n return ListView.builder(\n shrinkWrap: true,\n scrollDirection: Axis.vertical,\n itemCount: snapshot.data.dataList.length,\n itemBuilder: (BuildContext context, int index){\n return SingleChildScrollView(\n child: DataTable(\n columns: (snapshot.data.headerList[index] as List).map((item) =>\n DataColumn(\n label:(\n List.generate(item.length,(index){\n return Text(item[index].toString());\n })\n )\n )).toList(),\n rows: (snapshot.data.dataList[index].dataList as List).map((item) =>\n \n DataRow(\n \n cells:<DataCell>[\n DataCell(\n List.generate(item.length,(index){\n return Text(item[index].toString());\n })\n )\n ])).toList(),\n ),\nRun Code Online (Sandbox Code Playgroud)\n这是 JSON 响应
\n "DayEnd": {\n "ColumnWidths": "40\xc2\xb4168\xc2\xb496\xc2\xb496\xc2\xb4108\xc2\xb4156",\n "Headers": "SL.>\xc2\xb4Customer< \xc2\xb4Balance Qty>\xc2\xb4Amount>\xc2\xb4Oldest / Recent ",\n "FieldSeparator": "\xc2\xb4",\n "DataList": [\n {\n "Data": "1. \xc2\xb4ABD \xc2\xb414 / 14.60\xc2\xb411,090\xc2\xb4313 …Run Code Online (Sandbox Code Playgroud) 目标和问题:我正在尝试通过 DataTable 小部件为我的应用程序创建一个包含逐项的结帐页面。但我得到了 13 像素的溢出错误:
右侧的 RenderFlex 溢出了 23 个像素。相关的导致错误的小部件是 DataTable
造成此问题的原因是什么以及补救措施是什么?
图片:
代码:
Expanded(
flex: 8,
child: Container(
padding: EdgeInsets.all(10),
child: DataTable(
columns: [
DataColumn(
label: Text(
'#',
style: GoogleFonts.ubuntuMono(
color: colorPalette.chooseColor('orange'),
fontSize: 17),
),
),
DataColumn(
label: Text(
'Menu Item',
style: GoogleFonts.ubuntuMono(
color: colorPalette.chooseColor('orange'),
fontSize: 17),
),
),
DataColumn(
label: Text(
'Item Price',
style: GoogleFonts.ubuntuMono(
color: colorPalette.chooseColor('orange'),
fontSize: 17),
),
),
DataColumn(
label: Text(
'-',
style: GoogleFonts.ubuntuMono(
color: colorPalette.chooseColor('orange'),
fontSize: 17),
),
),
],
rows: [
DataRow(cells: …Run Code Online (Sandbox Code Playgroud) 我想使用数据表或表创建这样的表。但数据表对整个行和列进行装饰。并且表没有 margin 参数来添加之间的边距。
这是表代码:
return Table(
defaultVerticalAlignment: TableCellVerticalAlignment.middle,
children: [
TableRow(
decoration: BoxDecoration(
color: Color.fromRGBO(237, 239, 245, 1),
borderRadius: BorderRadius.all(Radius.circular(8)),
),
children: [
headerItem("Name"),
headerItem("Email"),
headerItem("Video Courses"),
headerItem("Webinar Courses"),
headerItem("Total course view time"),
headerItem("Progress", flex: 1),
headerItem("Details", flex: 1),
],
),
TableRow(
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12), boxShadow: [AppShadow.simple]),
children: [
item(
child: Row(
children: [CircleAvatar(), Text("\t\t\tKristin Watson", style: AppTextStyle.cardTitle)],
),
),
item(child: FittedBox(child: Text("dolores.chambers@example.com", style: AppTextStyle.body))),
item(child: Text("3 Courses", style: AppTextStyle.body)),
item(child: Text("7 Courses", style: AppTextStyle.body)),
item(child: Text("Time Spent: …Run Code Online (Sandbox Code Playgroud)