Advertisement
Guest User

Untitled

a guest
Apr 7th, 2022
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. <StyledDataTable>
  2. <DataTable
  3. dataKey="id"
  4. sortMode="multiple"
  5. id="invoiceTable"
  6. key={this.props.rootStore.loaderStore.invoiceTableKey}
  7. lazy={true}
  8. emptyMessage={this.props.t("common.emptyMessage")}
  9. onSelectionChange={(e) => this.onSelectionChange(e)}
  10. onPage={(e) => this.onPageChange(e)}
  11. onSort={(e) => this.onPageChange(e)}
  12. onFilter={(e) => this.onPageChange(e)}
  13. rows={queryParams.rows}
  14. first={queryParams.first}
  15. filters={queryParams.filters as any}
  16. multiSortMeta={queryParams.multiSortMeta}
  17. value={invoices}
  18. autoLayout={shrinked}
  19. //responsiveLayout={!shrinked ? "scroll" : null}
  20. scrollable={shrinked ? true : false}
  21. totalRecords={totalCount}
  22. selection={this.state.selectedInvoices}
  23. paginatorLeft={this.getSelectedItemsTemplate()}
  24. paginator
  25. currentPageReportTemplate={getCurrentPageReportTemplate()}
  26. paginatorTemplate={getPaginatorTemplate()}
  27. rowsPerPageOptions={[20, 50, 100]}
  28. filterDisplay="row"
  29. >
  30. <Column
  31. key={"selectInvoice"}
  32. style={{ width: "2rem" }}
  33. field={"selectInvoice"}
  34. selectionMode={"multiple"}
  35. reorderable={false}
  36. />
  37. {selectedColumns &&
  38. this.getColumns(selectedColumns, queryParams)}
  39. <Column
  40. frozen={shrinked}
  41. alignFrozen="right"
  42. body={this.actionBodyTemplate}
  43. style={{ width: "4rem" }}
  44. />
  45. </DataTable>
  46. </StyledDataTable>
  47.  
  48. actionBodyTemplate = (rowData: any): JSX.Element => {
  49. return (
  50. <div
  51. style={{display: "flex"}}
  52. >
  53. <Button
  54. id={`id-${rowData.id}-comment`}
  55. className={`p-button-rounded p-button-text p-button-icon-only ${rowData.commented ? "blubicon-comment-active" : "blubicon-comment"}`}
  56. onClick={(e) => this.openCommentModal(rowData,e)}
  57. />
  58. <Tooltip
  59. showDelay={1000}
  60. target={`#id-${rowData.id}-comment`}
  61. content={this.props.t("entityInvoice.properties.message")}
  62. position={"left"}
  63. />
  64. {this.props.rootStore.userStore.hasRoles([userRoles.user, userRoles.audit,userRoles.admin]) && (
  65. <Button
  66. id={`id-${rowData.id}-history`}
  67. className={
  68. this.props.rootStore.invoiceStore.shrinked
  69. ? "p-button-rounded p-button-text p-button-icon-only"
  70. : "p-button-rounded p-button-text p-button-icon-only"
  71. }
  72. onClick={() => this.openHistoryModal(rowData)}
  73. >
  74. <i className="blubicon-info" />
  75. </Button>
  76. )}
  77. </div>
  78. );
  79. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement