Commit 653d6db3 authored by Julia Radzhabova's avatar Julia Radzhabova

[SSE] Отладка изменения имени таблицы.

parent 4e85243c
...@@ -58,7 +58,7 @@ ...@@ -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([ ...@@ -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
}); });
...@@ -144,19 +144,19 @@ define([ ...@@ -144,19 +144,19 @@ define([
menu : new Common.UI.Menu({ menu : new Common.UI.Menu({
menuAlign: 'tr-br', menuAlign: 'tr-br',
items: [ items: [
{ caption: this.selectRowText, value: c_oAscChangeSelectionFormatTable.row, idx: 0 }, { caption: this.selectRowText, value: c_oAscChangeSelectionFormatTable.row, idx: 0 },
{ caption: this.selectColumnText, value: c_oAscChangeSelectionFormatTable.column, idx: 1 }, { caption: this.selectColumnText, value: c_oAscChangeSelectionFormatTable.column, idx: 1 },
{ caption: this.selectDataText, value: c_oAscChangeSelectionFormatTable.data, idx: 2 }, { caption: this.selectDataText, value: c_oAscChangeSelectionFormatTable.data, idx: 2 },
{ caption: this.selectTableText, value: c_oAscChangeSelectionFormatTable.all, idx: 3 }, { caption: this.selectTableText, value: c_oAscChangeSelectionFormatTable.all, idx: 3 },
{ caption: '--' }, { caption: '--' },
{ caption: this.insertRowAboveText, value: c_oAscInsertOptions.InsertTableRowAbove, idx: 4 }, { caption: this.insertRowAboveText, value: c_oAscInsertOptions.InsertTableRowAbove, idx: 4 },
{ caption: this.insertRowBelowText, value: c_oAscInsertOptions.InsertTableRowBelow, idx: 5 }, { caption: this.insertRowBelowText, value: c_oAscInsertOptions.InsertTableRowBelow, idx: 5 },
{ caption: this.insertColumnLeftText, value: c_oAscInsertOptions.InsertTableColLeft, idx: 6 }, { caption: this.insertColumnLeftText, value: c_oAscInsertOptions.InsertTableColLeft, idx: 6 },
{ caption: this.insertColumnRightText, value: c_oAscInsertOptions.InsertTableColRight, idx: 7 }, { caption: this.insertColumnRightText, value: c_oAscInsertOptions.InsertTableColRight, idx: 7 },
{ 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([ ...@@ -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([ ...@@ -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([ ...@@ -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([ ...@@ -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',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment