Last active
April 9, 2016 19:50
-
-
Save ljack/832fd274410e3f4ab6aa44800ea8f76c to your computer and use it in GitHub Desktop.
GriddleGriddle ColumnMeta's with some custom components
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GriddleGriddle ColumnMeta's with some custom components | |
export const ColumnMeta = [{ | |
"columnName": "name", | |
}, { | |
"columnName": "url", | |
"displayName": "URL" | |
}, { | |
"columnName": "method", | |
}, { | |
"columnName": "lastResult", | |
"customComponent": (props) => <span>{props.rowData.lastResult.slice(0,80).replace(/\s*/g,"").slice(0,30)+".."}</span>, | |
}, { | |
"columnName": "rowButtons", | |
"customComponent": ButtonsComponent, | |
"displayName": "" | |
} | |
]; | |
// Component which groups row buttons | |
export const ButtonsComponent = React.createClass({ | |
render: function() { | |
return ( | |
<form className="form-inline" style={paddingStyle}> | |
<CodeButton rowData={this.props.rowData} /> <EditComponent rowData={this.props.rowData} /> <DeleteComponent rowData={this.props.rowData} /> <JsonComponent title="lastResult" rowData={JSON.parse( this.props.rowData.lastResult )} /> <StartButton rowData={this.props.rowData}/> | |
</form> | |
); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment