0

https://github.com/GriddleGriddle/Griddle

用于 React 的烤盘

列属性设置为visible = 'false',不起作用。有没有人对此有修复或解决方法?

const columnMeta = [
    {
     'columnName': 'Date Submitted',
      customComponent: CustomDateComponent
    }
    {
      'columnName':'Action',
      'sortable':false,
      'visible':false
    }
  ];
4

1 回答 1

1

我通过这个烤盘找到了解决方案: https ://jsfiddle.net/inillie/m374gnxd/

 var TestTable = React.createClass({
  getInitialState: function() {
    return {
      test: [{
        firstName: "Foo",
        lastName: "Bar",
        userId: "foo",
        someStuff: "SCIEN"  
      }]
    };
  },
  render: function() {
    return ( < div >
      < Griddle results = {
        this.state.test
      }
      columnMetadata = {
        columnMeta
      }
      columns = {
        ['firstName', 'lastName', 'someStuff']
      }
      /> < /div>
    );
  }
});

基本上,您可以在 Griddle 渲染中使用名为 columns 的自定义属性来确保显示哪些列。

于 2016-10-04T16:53:22.910 回答