Comments (8)
1、问题将在下次版本修复
2、目前设计风格如此,考虑通过开放自定义td样式来实现
from ng-devui.
1、问题将在下次版本修复
2、目前设计风格如此,考虑通过开放自定义td样式来实现
thank 另外建议可否增加列宽调整和列拖拽后的保存功能
from ng-devui.
1、问题将在下次版本修复
2、目前设计风格如此,考虑通过开放自定义td样式来实现thank 另外建议可否增加列宽调整和列拖拽后的保存功能
这些都有事件,通过事件回调自己保存
from ng-devui.
child: my-component
<...>
<d-data-table>
<!-- 固定列-->
<d-column field="$index" header="index" width="60px"></d-column>
<!-- 自定义列 由上级传入-->
<ng-content ngProjectAs="d-column" select="d-column"></ng-content>
</d-data-table>
</...>
father
<my-component>
<d-column field="test1" header="test1" width="60px"></d-column>
<d-column field="test2" header="test2" width="60px">
<!-- 自定义cell-->
</d-column>
</my-component>
请教一下大佬, 为什么按以上的方法只能显示固定列.
如果改为
<ng-container ngProjectAs="d-column" *ngTemplateOutlet="tmp"> </ng-container>
<ng-template #tmp>
<d-column field="key" header="key" width="160px"></d-column>
</ng-template>
方式, 则tmp必须在d-data-table标签之下才能显示, 标签外或者由上级传入无法显示
可否解释一下是哪里用错了,该如何解决, 不胜感谢
from ng-devui.
child: my-component
<...> <d-data-table> <!-- 固定列--> <d-column field="$index" header="index" width="60px"></d-column> <!-- 自定义列 由上级传入--> <ng-content ngProjectAs="d-column" select="d-column"></ng-content> </d-data-table> </...>
father
<my-component> <d-column field="test1" header="test1" width="60px"></d-column> <d-column field="test2" header="test2" width="60px"> <!-- 自定义cell--> </d-column> </my-component>
请教一下大佬, 为什么按以上的方法只能显示固定列.
如果改为<ng-container ngProjectAs="d-column" *ngTemplateOutlet="tmp"> </ng-container> <ng-template #tmp> <d-column field="key" header="key" width="160px"></d-column> </ng-template>
方式, 则tmp必须在d-data-table标签之下才能显示, 标签外或者由上级传入无法显示
可否解释一下是哪里用错了,该如何解决, 不胜感谢
你的需求是自定义cell吗?参考API中自定义cell的部分:
<d-column field="gender" header="Gender" [sortable]="true" [width]="'100px'">
<d-cell>
<ng-template let-cellItem="cellItem">
<span dTooltip [content]='cellItem' [position]="'bottom'">
{{cellItem.toUpperCase()}}
</span>
</ng-template>
</d-cell>
</d-column>
from ng-devui.
child: my-component
<...> <d-data-table> <!-- 固定列--> <d-column field="$index" header="index" width="60px"></d-column> <!-- 自定义列 由上级传入--> <ng-content ngProjectAs="d-column" select="d-column"></ng-content> </d-data-table> </...>
father
<my-component> <d-column field="test1" header="test1" width="60px"></d-column> <d-column field="test2" header="test2" width="60px"> <!-- 自定义cell--> </d-column> </my-component>
请教一下大佬, 为什么按以上的方法只能显示固定列.
如果改为<ng-container ngProjectAs="d-column" *ngTemplateOutlet="tmp"> </ng-container> <ng-template #tmp> <d-column field="key" header="key" width="160px"></d-column> </ng-template>
方式, 则tmp必须在d-data-table标签之下才能显示, 标签外或者由上级传入无法显示
可否解释一下是哪里用错了,该如何解决, 不胜感谢你的需求是自定义cell吗?参考API中自定义cell的部分:
<d-column field="gender" header="Gender" [sortable]="true" [width]="'100px'"> <d-cell> <ng-template let-cellItem="cellItem"> <span dTooltip [content]='cellItem' [position]="'bottom'"> {{cellItem.toUpperCase()}} </span> </ng-template> </d-cell> </d-column>
不是, 是自定义列或者说动态列. 如果按api中的在ts中设置
dataTableOptions = {
columns: [
{
field: 'firstName',
header: 'First Name',
fieldType: 'text'
},
{
field: 'test1',
header: 'test1',
fieldType: 'text'
},
{
field: 'test2',
header: 'test2',
fieldType: 'text'
}
]
};
这样的话,列是可以根据dataTableOptions 改变而动态,
但是此时test1或者test2 列想动态单元格内容和样式 就无法办到.
因为不确定这张表需要的是test1或test2字段,或者甚至是test3, test4 字段
这些数据会在父级传入时得出.
现在想完成的需求是这样: 有多张表格, 每张表格有部分字段相同, 部分字段不同. 不同字段的单元格内容和样式也不尽相同. 所以想抽出一张公共表.能实现相同的字段的单元格内容和样式直接在公共表里定义完. 不同字段的单元格内容和样式 由在使用这张公共表的父组件中定义
感觉可能是
devui\data-table\data-table.component.ts
205行 @ContentChildren(DataTableColumnTmplComponent) columns: QueryList<DataTableColumnTmplComponent>;
此处的columns
<...>
<!--可获得-->
<d-column ...></d-column>
<!--动态部分无法获得-->
<ng-content .....></ng-content>
</...>
因为是多级传递 ContentChildren无法获得到
from ng-devui.
Metadata Properties: descendants或许可以解决这个问题
from ng-devui.
以其他方式解决了
还是谢谢大佬的回答
from ng-devui.
Related Issues (20)
- 🐛 [Bug]: dialog弹窗未禁止页面滚动条 HOT 1
- ✨ [Feature]: Modal 模态弹窗添加全屏功能 HOT 3
- 🐛 [Bug]: 主题功能存在bug HOT 2
- ✨ [Feature]: 能否在 Color 板块让开发者动态切换各个样式颜色,并将可见效果同步到其他板块(如“Primary 按钮样式”) HOT 1
- 🐛 [Bug]: 高级列表调整列宽,不会根据鼠标拖动调节想要的列宽 HOT 4
- ✨ [Bug]: Cascader不是受控组件么?目前通过form表单 拿不到值 HOT 3
- ✨ [Feature]: ng版本data-table组件在视图模式下负责呈现单元格内容的自定义组件 HOT 2
- 🐛 [Bug]: DatePickerPro组件最外层的圆角没有设置,在有色背景下显示突兀 HOT 1
- 🐛 [Bug]: DropDown下拉菜单控制台有警告信息 HOT 2
- 🐛 [Bug]: dTextInput组件设置size不起作用 HOT 1
- ✨ [Feature]: 建议对d-casader组件增加回调函数控制是否可选 HOT 3
- Modal cssClass属性不生效🐛 [Bug]: HOT 1
- 🐛 [Bug]: tabs中签入iframe的问题 HOT 1
- 🐛 [Bug]: Transfer 穿梭框,自定义穿梭框 HOT 1
- ✨ [Feature]: Cascader勾选父级时,不带父级与子级的值 HOT 3
- 🐛 [Bug]: dialog组件,打开modal框的时候,配置buttons属性为空数组,模态框底部区域出现大片留白 HOT 1
- 🐛 [Bug]: Accordion未正确隐藏Icon标签,导致左侧不能对齐
- 🐛 [Bug]: toggle HOT 1
- ✨ [Feature]: 请教一下,有没有办法可以在不同的页面来设置这个页面的主题,而不是整个项目的? HOT 1
- [Issue管理]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng-devui.