Skip to content

Commit

Permalink
wc: fix refresh job button in job browser
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodielm committed Oct 30, 2023
1 parent 1b6a48a commit d09bfde
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/webcomponents/commons/opencb-grid-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ export default class OpencbGridToolbar extends LitElement {
</div>
`) : nothing}
${this._settings.showRefresh ? html`
<button type="button" class="btn btn-default btn-sm" @click="${() => LitUtils.dispatchCustomEvent(this, "refresh")}">
<i class="fas fa-sync-alt icon-padding"></i> Refresh
</button>
` :nothing}
<!-- Second, display elements configured -->
${this._config?.create && (this._settings.showCreate || this._settings.showNew) ? html`
<div class="btn-group">
Expand Down
8 changes: 7 additions & 1 deletion src/webcomponents/job/job-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default class JobGrid extends LitElement {
this.gridCommons = new GridCommons(this.gridId, this, this._config);

this.toolbarSetting = {
...this.config,
...this._config,
// columns: this._getDefaultColumns().filter(col => col.field)
};

Expand Down Expand Up @@ -319,6 +319,10 @@ export default class JobGrid extends LitElement {
this.gridCommons.onColumnChange(e);
}

onRefresh() {
this.table.bootstrapTable("refresh");
}

detailFormatter(value, row) {
let result = "<div class='row' style='padding-bottom: 20px'>";
let detailHtml = "";
Expand Down Expand Up @@ -588,6 +592,7 @@ export default class JobGrid extends LitElement {
@columnChange="${this.onColumnChange}"
@download="${this.onDownload}"
@export="${this.onDownload}"
@refresh="${this.onRefresh}"
@actionClick="${e => this.onActionClick(e)}"
@jobCreate="${this.renderRemoteTable}">
</opencb-grid-toolbar>` : nothing
Expand Down Expand Up @@ -626,6 +631,7 @@ export default class JobGrid extends LitElement {
showCreate: true,
showExport: true,
showSettings: true,
showRefresh: true,
showActions: true,
detailView: true,
detailFormatter: this.detailFormatter,
Expand Down

0 comments on commit d09bfde

Please sign in to comment.