-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added better configuration of buttons in 'control' field. #317
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,8 @@ | |
deleteButton: true, | ||
clearFilterButton: true, | ||
modeSwitchButton: true, | ||
searchButton: true, | ||
insertButton: true, | ||
|
||
_initConfig: function() { | ||
this._hasFiltering = this._grid.filtering; | ||
|
@@ -91,16 +93,16 @@ | |
}, | ||
|
||
filterTemplate: function() { | ||
var $result = this._createSearchButton(); | ||
var $result = this.searchButton ? this._createSearchButton() : $(""); | ||
return this.clearFilterButton ? $result.add(this._createClearFilterButton()) : $result; | ||
}, | ||
|
||
insertTemplate: function() { | ||
return this._createInsertButton(); | ||
return this.insertButton ? this._createInsertButton() : $(""); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For insert button (the same as for update button): how user can insert an item without this button? |
||
}, | ||
|
||
editTemplate: function() { | ||
return this._createUpdateButton().add(this._createCancelEditButton()); | ||
return this.editButton ? this._createUpdateButton().add(this._createCancelEditButton()) : $(""); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure, why do we need to hide update & cancel button for edit row? |
||
}, | ||
|
||
_createFilterSwitchButton: function() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The initial idea behind was: If user needs filtering, he probably needs the search button. If he doesn't need filtering, he can turn it off with the
filtering
option.Do you have scenario when you need to hide search button? And what is about the button to clear filter? Is it stays visible on purpose?