Sencha said that my report is a duplicate of this one:
http://www.sencha.com/forum/showthread.php?136911
For some reason it is not fixed for long time. I don't know a reason, I will just monitor.
For now I can suggest a workaround to get a current value, I added the respective comment in the script.
Also please note the example doesn't take the emptyCellText property into account.
Example
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
Store store = this.GridPanel1.GetStore();
store.DataSource = new object[]
{
new object[] { "test1", "test2" },
new object[] { "test3", "test4" }
};
store.DataBind();
}
}
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
<script type="text/javascript">
var onValidateEdit = function (editingPlugin, e) {
var store = e.grid.getStore(),
editor = editingPlugin.getEditor(e.record, e.column), // These two lines are a workaround for e.value
value = editor.getValue(), // http://www.sencha.com/forum/showthread.php?136911
cancel = false;
store.each(function (record, index) {
Ext.each(e.grid.columns, function (column) {
if (!(e.column === column && index === e.rowIdx) //to do not compare with the current cell
&& record.data[column.dataIndex] === value) {
cancel = true;
alert(Ext.String.format("The value must be unique. The '{0}' column, {1} row (zero-based index) has the same value.", column.text, index))
return false;
}
});
if (cancel) {
return false;
}
});
return !cancel;
};
</script>
</head>
<body>
<ext:ResourceManager runat="server" />
<ext:GridPanel ID="GridPanel1" runat="server">
<Store>
<ext:Store runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="test1" />
<ext:ModelField Name="test2" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:Column
runat="server"
Text="Test 1"
DataIndex="test1">
<Editor>
<ext:TextField runat="server" />
</Editor>
</ext:Column>
<ext:Column
runat="server"
Text="Test 2"
DataIndex="test2">
<Editor>
<ext:TextField runat="server" />
</Editor>
</ext:Column>
</Columns>
</ColumnModel>
<Plugins>
<ext:CellEditing runat="server" ClicksToEdit="1">
<Listeners>
<ValidateEdit Fn="onValidateEdit" />
</Listeners>
</ext:CellEditing>
</Plugins>
</ext:GridPanel>
</body>
</html>