[SSE] Отладка изменения имени таблицы.
This commit is contained in:
parent
4e85243c90
commit
653d6db3d1
|
@ -58,7 +58,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=2 class="padding-small">
|
<td colspan=2 class="padding-small">
|
||||||
<div id="table-txt-name" class="input-row" style="width: 100%;"/>
|
<div id="table-txt-name" class="input-row" style="width: 100%;"></div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -126,7 +126,7 @@ define([
|
||||||
|
|
||||||
this.txtTableName = new Common.UI.InputField({
|
this.txtTableName = new Common.UI.InputField({
|
||||||
el : $('#table-txt-name'),
|
el : $('#table-txt-name'),
|
||||||
name : 'name',
|
name : 'tablename',
|
||||||
style : 'width: 100%;',
|
style : 'width: 100%;',
|
||||||
validateOnBlur: false
|
validateOnBlur: false
|
||||||
});
|
});
|
||||||
|
@ -156,7 +156,7 @@ define([
|
||||||
{ caption: '--' },
|
{ caption: '--' },
|
||||||
{ caption: this.deleteRowText, value: c_oAscDeleteOptions.DeleteRows, idx: 8 },
|
{ caption: this.deleteRowText, value: c_oAscDeleteOptions.DeleteRows, idx: 8 },
|
||||||
{ caption: this.deleteColumnText, value: c_oAscDeleteOptions.DeleteColumns, idx: 9 },
|
{ caption: this.deleteColumnText, value: c_oAscDeleteOptions.DeleteColumns, idx: 9 },
|
||||||
{ caption: this.deleteTableText, value: c_oAscDeleteOptions.DeleteColumns, idx: 10 }
|
{ caption: this.deleteTableText, value: c_oAscDeleteOptions.DeleteTable, idx: 10 }
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
@ -199,7 +199,14 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onTableNameChanged: function(input, newValue, oldValue) {
|
onTableNameChanged: function(input, newValue, oldValue) {
|
||||||
|
var oldName = this._state.TableName;
|
||||||
this._state.TableName = '';
|
this._state.TableName = '';
|
||||||
|
|
||||||
|
if (oldName.toLowerCase() == newValue.toLowerCase()) {
|
||||||
|
Common.NotificationCenter.trigger('edit:complete', this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var me = this,
|
var me = this,
|
||||||
isvalid = this.api.asc_checkDefinedName(newValue, null);
|
isvalid = this.api.asc_checkDefinedName(newValue, null);
|
||||||
if (isvalid.asc_getStatus() === true) isvalid = true;
|
if (isvalid.asc_getStatus() === true) isvalid = true;
|
||||||
|
@ -209,7 +216,7 @@ define([
|
||||||
isvalid = this.textIsLocked;
|
isvalid = this.textIsLocked;
|
||||||
break;
|
break;
|
||||||
case c_oAscDefinedNameReason.Existed:
|
case c_oAscDefinedNameReason.Existed:
|
||||||
isvalid = (oldValue.toLowerCase() == newValue.toLowerCase()) ? true : this.textExistName;
|
isvalid = this.textExistName;
|
||||||
break;
|
break;
|
||||||
case c_oAscDefinedNameReason.NameReserved:
|
case c_oAscDefinedNameReason.NameReserved:
|
||||||
isvalid = this.textReservedName;
|
isvalid = this.textReservedName;
|
||||||
|
@ -219,7 +226,7 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isvalid === true) {
|
if (isvalid === true) {
|
||||||
// this.api.asc_editDefinedNames(this._state.TableName, new Asc.asc_CDefName(newValue, this._state.Range, null, true));
|
this.api.asc_changeDisplayNameTable(oldName, newValue);
|
||||||
Common.NotificationCenter.trigger('edit:complete', this);
|
Common.NotificationCenter.trigger('edit:complete', this);
|
||||||
} else if (!this._state.TableNameError) {
|
} else if (!this._state.TableNameError) {
|
||||||
this._state.TableNameError = true;
|
this._state.TableNameError = true;
|
||||||
|
@ -421,7 +428,7 @@ define([
|
||||||
textTableName : 'Table Name',
|
textTableName : 'Table Name',
|
||||||
textResize : 'Resize table',
|
textResize : 'Resize table',
|
||||||
textSelectData : 'Select Data',
|
textSelectData : 'Select Data',
|
||||||
textInvalidName : 'ERROR! Invalid range name',
|
textInvalidName : 'ERROR! Invalid table name',
|
||||||
textExistName : 'ERROR! Range with such a name already exists',
|
textExistName : 'ERROR! Range with such a name already exists',
|
||||||
textIsLocked : 'This element is being edited by another user.',
|
textIsLocked : 'This element is being edited by another user.',
|
||||||
notcriticalErrorTitle : 'Warning',
|
notcriticalErrorTitle : 'Warning',
|
||||||
|
|
Loading…
Reference in a new issue