Skip to content

Commit

Permalink
Add AttributeTable showLimitToExtent config prop
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Mar 8, 2024
1 parent b842bfd commit c8acfab
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugins/AttributeTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class AttributeTable extends React.Component {
setCurrentTaskBlocked: PropTypes.func,
/** Whether to show a button to open the edit form for selected layer. Requires the Editing plugin to be enabled. */
showEditFormButton: PropTypes.bool,
/** Whether to show the "Limit to extent" checkbox */
showLimitToExtent: PropTypes.bool,
taskData: PropTypes.object,
theme: PropTypes.object,
/** The zoom level for zooming to point features. */
Expand Down Expand Up @@ -245,9 +247,11 @@ class AttributeTable extends React.Component {
<input disabled={this.state.changedFeatureIdx !== null} onChange={ev => this.updateFilter("filterVal", ev.target.value, true)} type="text" value={this.state.filterVal} />
<button className="button" disabled={this.state.changedFeatureIdx !== null} onClick={() => this.updateFilter("filterVal", "")} value={this.state.filterValue}><Icon icon="clear" /></button>
</div>
<div>
<label><input checked={this.state.limitToExtent} onChange={(ev) => this.setState({limitToExtent: ev.target.checked})} type="checkbox" /> {LocaleUtils.tr("attribtable.limittoextent")}</label>
</div>
{this.props.showLimitToExtent ? (
<div>
<label><input checked={this.state.limitToExtent} onChange={(ev) => this.setState({limitToExtent: ev.target.checked})} type="checkbox" /> {LocaleUtils.tr("attribtable.limittoextent")}</label>
</div>
) : null}
</div>
);
}
Expand Down

0 comments on commit c8acfab

Please sign in to comment.