Fixed the issue #555

This commit is contained in:
Prashant Singh 2019-02-08 13:02:25 +05:30
parent 003f2e0b42
commit cd6d6c89a8
2 changed files with 11 additions and 1 deletions

View File

@ -2,6 +2,7 @@
return [
'datagrid' => [
'actions' => 'Actions',
'id' => 'Index columns have value greater than zero only',
'massaction' => [
'mass-delete-confirm' => 'Do you really want to delete these selected :resource?',

View File

@ -228,6 +228,7 @@
template: '#datagrid-filters',
data: () => ({
filterIndex: @json($results['index']),
gridCurrentData: @json($results['records']),
massActions: @json($results['massactions']),
massActionsToggle: false,
@ -338,7 +339,15 @@
if (this.type == 'string') {
this.formURL(this.columnOrAlias, this.stringCondition, this.stringValue, label)
} else if (this.type == 'number') {
this.formURL(this.columnOrAlias, this.numberCondition, this.numberValue, label);
indexConditions = true;
if (this.filterIndex == this.columnOrAlias && (this.numberValue == 0 || this.numberValue < 0)) {
indexConditions = false;
alert('index columns can have values greater than zero only');
}
if(indexConditions)
this.formURL(this.columnOrAlias, this.numberCondition, this.numberValue, label);
} else if (this.type == 'boolean') {
this.formURL(this.columnOrAlias, this.booleanCondition, this.booleanValue, label);
} else if (this.type == 'datetime') {