uxcore / uxcore-table Goto Github PK
View Code? Open in Web Editor NEWTable Component based on React
Home Page: http://uxco.re/components/table/
Table Component based on React
Home Page: http://uxco.re/components/table/
addEventListener is used in src/header/index.js
, which is not supported in IE8.
Introducing jquery will fix this problem.
动态改变 pageSize的时候,滚动条不是我想要的
或者 高度就自适应也不错
var queryObj = {};
_this.props.params.forEach(function (key) {
if (ctx.props.__rowData[key]) {
queryObj[key] = ctx.props.__rowData[key];
}
});
如果 ctx.props.__rowData[key] 值为0的话,则不会进去 queryObj,但很多情况下表格的值可能为0
变成支持 text 和 callback 的模式,searchbar 从定义项中挪出。
using render
will be easier and more flexible.
{ dataKey: 'person', title: "申请人", width: 200, render: function(rowData) {
return <Hovercard emplId={rowData.personId} placement="right">
<div style={{
display: "inline-block"
}}>{rowData.person}</div>
</Hovercard>
}},
if we do not set props headerHeight,header will not show.
That's nonsense. header should always show unless I set it hidden.
Now paging is done by calculating data.length, which is wrong.
如题。
有时可能要对一行的样式,进行一个统一的定制。提供一个 hook,使用户可以根据 rowData,追加一行的类名。
actions 里的 callback 有时无法通过 refs 拿到 grid 的实例,从而无法调用 API。
场景:
render() {
var Grid = <Grid ref="grid" />
return (
<div>
<SomeComp comp={Grid}/> // 在这样的情况下 refs 拿不到 grid,拿不到 grid 的原因,是因为 Grid 并没有在 render 里实例化,如果是以子元素方式传进去,就没有这个问题。
</div>
);
}
这种场景出现在 uxcore-fis-grid 中,因为填写 url 和 模板就可以完成某些功能,所以 comp 就必须要传进去了。
目前想到的解决方法是
actions: {
'增加': function(rowData, actions) {actions.addEmptyRow()}
}
Support row edit ?
grid的view mode, radio,checkbox disable 需要支持
原因是 props.jsxdata 只在组件初始化时传入过一次,之后 props 更改,不会再去修改 state.data,但不能在 willReceiveProps 的时候调用 fetchData,这样会导致频繁地发 ajax 请求。因此只能单独 set
in Demo, some props are not illustrated like fetchParams. And some props are not easy to understand, which need a written explanation.
fetchParams is a string now which is not easy to use
如图 第一次Loading数据的时候,背景后有个没有数据。
场景:需要对checkbox进行disable
React 一直倡导的是 stateless 的组件,越是小颗粒的组件,越应该保证自己内部无状态,其 View 表现完全由父级组件传导的 props 来控制,以此来完成对于子组件的绝对控制。子组件不保有自己的状态,是实现“改变 props 即改变 view”这一终极目的 的先决条件。子组件在发生改变时,不是立刻改变自己的值,而是通过回调将改动通知给父级,再由父级做出更改,这样的行为虽然显得有些绕,但使得数据总是单向地从父级传递给子级。
Grid 相比 Form,其内部状态其实是可以比较少的。毕竟内部的交互较少,大多是以展示为主。我们下一个重构版本,应该考虑的是如何不改变组件内 props 的情况下,通过只在 Grid 一层设置 state来完成我们现有的所有功能。
in sub mode, grid body should not has border, cause the parent already has.
And people always want to align the parent and the sub grid, so width should not be cared.
目前只有一级表格的表头悬停
但是subList的数据多,向下滚动,然后表头展示的还是父级的
any other?
因为支持横向滚动的关系,grid 的容器是 display:inline-block,产生的问题是如果列宽总和不够,则会产生白边,故需自动补列,来补足宽度。需要考虑到 IE8 下对滚动条的兼容
view mode, every column just view
edit mode, column type will works, like select , text etc
pageSize is set to 10 now.
like
<Grid columns={columns} dataSource={data} />
主要需要考虑父 grid 有没有展开树,有没有 checkbox,子 grid 有没有展开树,有没有 checkbox,以及父元素如何通知子元素自己有没有两者。
父 grid 可以通过 passedData 告诉子 grid tree icon,如何告诉子 grid 有没有 checkbox?万一子 grid 自己有 tree icon 和 checkbox 怎么办。
Two types of warnings appear at console in Grid Demo, which need to avoid.
表格支持jsonp跨域请求
数据返回的format
一次请求 ,二级表格的同步数据展示
@majorye @eternalsky
类似于 actionBar 的改造方式
加入一个 modifyCell 的 方法,传回 children、rowIndex,colIndex,使用户有机会,对每一个节点进行自定义。
Grid cannot active correctly when re-render. may caused by something done in willMount but not in willUpdate
目前是灰色的,我们可以搞成链接的颜色
right now use type 'checkbox' , later use rowSelection property to config the row select feature,
more easy using
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.