Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from 'react';
- import axios from 'axios';
- const $ = require('jquery');
- $.Datatable = require('datatables.net');
- export default class Coba extends Component {
- constructor(props) {
- super(props);
- }
- componentDidMount(){
- var kolom = this.props.kolom;
- var data = this.props.data;
- console.log(kolom)
- console.log(data)
- // axios.get('https://next.json-generator.com/api/json/get/NkmVhBGB4', {
- // mode: 'no-cors',
- // headers: {
- // },
- // }).then(function(result) {
- $('#example').DataTable( {
- data: data,
- columns: kolom
- });
- // })
- }
- componentWillMount(){
- }
- render(){
- return (
- <div className="wrapper wrapper-content animated fadeInRight">
- <div className="row">
- <div className="col-lg-12">
- <div className="ibox float-e-margins">
- <div className="ibox-title">
- <h5>Basic Data Tables example with responsive plugin</h5>
- {/* <div className="ibox-tools">
- <a className="collapse-link">
- <i className="fa fa-chevron-up"></i>
- </a>
- <a className="dropdown-toggle" data-toggle="dropdown" href="#">
- <i className="fa fa-wrench"></i>
- </a>
- <ul className="dropdown-menu dropdown-user">
- <li><a href="#">Config option 1</a>
- </li>
- <li><a href="#">Config option 2</a>
- </li>
- </ul>
- <a className="close-link">
- <i className="fa fa-times"></i>
- </a>
- </div> */}
- </div>
- <div className="ibox-content">
- <table id="example" className="table table-striped table-bordered table-hover dataTables-example" width="100%"></table>
- </div>
- </div>
- </div>
- </div>
- </div>
- )
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement