0

https://github.com/GriddleGriddle/Griddle

Griddle Tables for React

Column property set to visible = 'false', not working. Does anyone have a fix or workaround for this?

const columnMeta = [
    {
     'columnName': 'Date Submitted',
      customComponent: CustomDateComponent
    }
    {
      'columnName':'Action',
      'sortable':false,
      'visible':false
    }
  ];
Sarim Zafar
  • 263
  • 1
  • 3
  • 7

1 Answers1

1

I found a solution to this via this griddle : 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>
    );
  }
});

Basically, you can use a custom property called columns inside your Griddle rendering to ensure which columns to show.

Sarim Zafar
  • 263
  • 1
  • 3
  • 7