Giter Site home page Giter Site logo

uxcore-table's Issues

remove column type 'person'

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>
            }},

add config addRowClassName

有时可能要对一行的样式,进行一个统一的定制。提供一个 hook,使用户可以根据 rowData,追加一行的类名。

item 的 actions 的 callback 中加入内置方法的调用

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()}
}

props jsxdata 变化时,grid 不会刷新View

原因是 props.jsxdata 只在组件初始化时传入过一次,之后 props 更改,不会再去修改 state.data,但不能在 willReceiveProps 的时候调用 fetchData,这样会导致频繁地发 ajax 请求。因此只能单独 set

readme needs to be supplemented

in Demo, some props are not illustrated like fetchParams. And some props are not easy to understand, which need a written explanation.

Grid 2.0: 尝试构建一个内部极少状态的复杂组件。

React 一直倡导的是 stateless 的组件,越是小颗粒的组件,越应该保证自己内部无状态,其 View 表现完全由父级组件传导的 props 来控制,以此来完成对于子组件的绝对控制。子组件不保有自己的状态,是实现“改变 props 即改变 view”这一终极目的 的先决条件。子组件在发生改变时,不是立刻改变自己的值,而是通过回调将改动通知给父级,再由父级做出更改,这样的行为虽然显得有些绕,但使得数据总是单向地从父级传递给子级。

Grid 相比 Form,其内部状态其实是可以比较少的。毕竟内部的交互较少,大多是以展示为主。我们下一个重构版本,应该考虑的是如何不改变组件内 props 的情况下,通过只在 Grid 一层设置 state来完成我们现有的所有功能。

subGrid border style & width calculation

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.

subtitle 进行悬停

目前只有一级表格的表头悬停
但是subList的数据多,向下滚动,然后表头展示的还是父级的

lock column feature

  1. sync the cell's height of two side
  2. sync the scrollTop of two side

any other?

子 grid 与父 grid 对齐

主要需要考虑父 grid 有没有展开树,有没有 checkbox,子 grid 有没有展开树,有没有 checkbox,以及父元素如何通知子元素自己有没有两者。

父 grid 可以通过 passedData 告诉子 grid tree icon,如何告诉子 grid 有没有 checkbox?万一子 grid 自己有 tree icon 和 checkbox 怎么办。

支持每个单元格自定义

加入一个 modifyCell 的 方法,传回 children、rowIndex,colIndex,使用户有机会,对每一个节点进行自定义。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.