Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.37 KB | None | 0 0
  1. ` {
  2. (this.state.categoryTable)?(
  3. <table id="categoryData" className="display" cellSpacing={0} width="100%">
  4. <thead>
  5. <tr>
  6. <th className="no-sort" style={{textAlign: 'center'}}>Icon</th>
  7. <th style={{textAlign: 'center'}}>{this.state.type} name</th>
  8. <th className="no-sort"></th>
  9. <th className="no-sort"></th>
  10. </tr>
  11. </thead>
  12. <tbody>
  13. {
  14. (this.state.categories.length > 0)?(
  15.  
  16. this.state.categories.map((category,key) => {
  17.  
  18.  
  19. return <tr style={{height: 40}}>
  20.  
  21. <td style={{textAlign: 'center'}}>
  22. <img src={category.image} id="headerProfilePic" style={{width: '50', height: '50',cursor: 'pointer',margin: 'auto'}} className="img-responsive" />
  23. </td>
  24. <td style={{textAlign: 'center'}}>{category.name}</td>
  25.  
  26.  
  27. <td className="col-md-2 col-sm-6" >
  28. <span className="btn btn-primary" type="button" id="postComment" style={{marginLeft: 10}} onClick={this.editAddModal.bind(this,category._id,category.name,category.image)}>
  29. <span style={{fontFamily: 'verdana',fontSize: 12}} >EDIT</span>
  30. </span>
  31. </td>
  32.  
  33. <td className="col-md-2 col-sm-6" >
  34.  
  35. {
  36. (category.isDelete)?(
  37. <span className="btn btn-success" type="button" id="postComment" style={{marginLeft: 10}} onClick={this.selectDeleteCategory.bind(this,category._id,category.isDelete)}>
  38. <span style={{fontFamily: 'verdana',fontSize: 12}} >ACTIVATE</span>
  39. </span>
  40. ):(
  41. <span className="btn btn-danger" type="button" id="postComment" style={{marginLeft: 10,width: 85}} onClick={this.selectDeleteCategory.bind(this,category._id,category.isDelete)}>
  42. <span style={{fontFamily: 'verdana',fontSize: 12}} >DELETE</span>
  43. </span>
  44. )
  45. }
  46.  
  47. </td>
  48.  
  49.  
  50.  
  51. </tr>
  52. })
  53. ):( null )
  54. }
  55.  
  56. </tbody>
  57. </table>
  58.  
  59. ):(null)
  60. }
  61.  
  62. `
  63.  
  64. `
  65.  
  66. $('#categoryData').DataTable( {
  67. "order": [],
  68. "columnDefs": [
  69. { "targets": 'no-sort',"orderable": false},
  70. { targets: [1], searchable: true },
  71. { targets: '_all', searchable: false } ]
  72. } );`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement