PDA

View Full Version : [CLOSED] grid validation questions



susanz
Feb 03, 2015, 8:41 PM
(I submit this ticket before, but cannot find it. This is resubmit.)

I have an editable dynamic grid (row editor). I need to do 2 types of validation : one blocking data if it is invalid, one is show warning message when data is load & changed. The first one works well with VType on row editor. What is good way for "Warning" ? I also need have "Warning" on group summery -- show warning message on grouping & on total changed.

Thanks
-szhang

RCN
Feb 03, 2015, 11:27 PM
Warn when data is loaded: Store's Load event listener.

Warn when data is edited: RowEditing's Edit event listener.

Validation Examples:
http://examples3.ext.net/#/GridPanel/Plugins/RowEditor/
http://examples3.ext.net/#/GridPanel/Plugins/RowEditor_Remote/

susanz
Feb 04, 2015, 2:05 AM
Hi Raphael, Thanks for your reply. Could you give me more details ?
1, Suppose I have 2 Vtypes on different columns, one is warning validation one is required. how Do I make row editor to enable save if only warning validation fails and block saving if Required validation fails?

2, how do I trigger validation for all data on the whole grid when store loaded? Is there any method like grid.Validate() ? assume I have several custom VType validations.

3, How do I validate column summary ? using SummaryRenderer.Fn ?

Thanks

szhang

RCN
Feb 04, 2015, 3:45 AM
1, Suppose I have 2 Vtypes on different columns, one is warning validation one is required. how Do I make row editor to enable save if only warning validation fails and block saving if Required validation fails?

It's done by default. Take a look on http://examples3.ext.net/#/GridPanel/Plugins/RowEditor/.

Save button is enabled when validation succeeds:
20311
But it's disabled when validation fails:
20321


2, how do I trigger validation for all data on the whole grid when store loaded? Is there any method like grid.Validate() ? assume I have several custom VType validations.

Row Editor (http://examples3.ext.net/#/GridPanel/Plugins/RowEditor/) does not allow to save if there is invalid data
Cell Editor (http://examples3.ext.net/#/GridPanel/Plugins/CellEditing/) reverts any invalid change.


how do I trigger validation for all data on the whole grid when store loaded

Are you gonna load invalid data? I suppose that saved data is already validated. Please expand on that.


Is there any method like grid.Validate() ?

I think that it's a bit invalid scenario. Going further that validation is performed by the column's editor, not by the column itself. So, if possible, you should access column's editor, and, somehow, validate column's value against its editor.

susanz
Feb 04, 2015, 4:14 AM
I guess I did not make the issue clear. I have two type of validations :
"Warning" -- the data can be saved but need to warn user. For example, if user enter salary $200000, we need show user the salary exceed $15000 but will allow user to save it, next time, when this data is reloaded, we need show the warning again.

"Required" -- this is default row editor validation, it blocks data saving with error message.

I have these 2 type of validations mixed in one grid, how do I make row editor to not block invalid "Warning" ?
Thanks

RCN
Feb 04, 2015, 4:33 AM
In the morning i will implement it for you.

susanz
Feb 04, 2015, 5:09 PM
great! I am looking forward to see your solution! Please note, my grid is all dynamic, we don't know the columns until the data is loaded from table.
Thanks
-szhang

RCN
Feb 04, 2015, 5:13 PM
I am pretty busy at this moment but later today i implement it, ok?

susanz
Feb 04, 2015, 5:25 PM
Sure, no problem.Thanks!

RCN
Feb 05, 2015, 1:44 PM
Let me know whether the following example helps you.



<script runat="server">
public class Entity
{
public int ID { get; set; }

public string Name { get; set; }

public float Salary { get; set; }
}

protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
Store store = this._grd.GetStore();


List<Entity> lst = new List<Entity>();

for (int index = 1; index < 15; index++)
{
lst.Add(new Entity
{
ID = index,
Name = string.Format("Name - {0}", index),
Salary = index * 1000
});
}

store.DataSource = lst;

store.DataBind();
}
}
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<script type="text/javascript">
var Edit = function (item, e) {
e.record.commit();

ProcessSummary();
}

var ProcessSummary = function () {
var records = App._grd.getStore().data.map;

var result = '';

for (var id in records) {

var rec = records[id];
if (rec.data.Salary > 10000) {

result = Ext.String.format('{0}<li>{1}</li>', result, rec.data.Name)
}
}
if (!Ext.isEmpty(result)) {
result = Ext.String.format('<b>Salaries > $ 10,000 (Employee Name)</b></br /><ul>{0}</ul>', result)
}

App._lblResult.setHtml(result);
}

var addEmployee = function () {
var grid = App._grd;
grid.editingPlugin.cancelEdit();

var recordID = App._str.getTotalCount() + 1;

grid.store.insert(0, { ID: recordID, Name: Ext.String.format('Name - {0}', recordID), Salary: recordID * 1000 });
grid.editingPlugin.startEdit(0, 0);
};

var removeEmployee = function () {
var grid = App._grd,
sm = grid.getSelectionModel();

grid.editingPlugin.cancelEdit();
grid.store.remove(sm.getSelection());
if (grid.store.getCount() > 0) {
sm.select(0);
}

ProcessSummary();
};

</script>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:GridPanel ID="_grd" runat="server" Width="600" Height="600" Border="true" Title="Employees">
<Store>
<ext:Store ID="_str" AutoLoad="true" runat="server">
<Model>
<ext:Model IDProperty="ID" runat="server">
<Fields>
<ext:ModelField Name="ID" Type="Int" />
<ext:ModelField Name="Name" Type="String" />
<ext:ModelField Name="Salary" Type="Float" />
</Fields>
</ext:Model>
</Model>
<Listeners>
<Load Handler="ProcessSummary();" />
</Listeners>
</ext:Store>
</Store>
<Plugins>
<ext:RowEditing runat="server" ClicksToMoveEditor="1" AutoCancel="false" >
<Listeners>
<Edit Handler="Edit(item, e);" />
</Listeners>
</ext:RowEditing>
</Plugins>
<TopBar>
<ext:Toolbar runat="server">
<Items>
<ext:Button runat="server" Text="Add Employee" Icon="UserAdd">
<Listeners>
<Click Fn="addEmployee" />
</Listeners>
</ext:Button>
<ext:Button ID="btnRemoveEmployee" runat="server" Text="Remove Employee" Icon="UserDelete" Disabled="true">
<Listeners>
<Click Fn="removeEmployee" />
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<ColumnModel>
<Columns>
<ext:Column runat="server" Text="ID" DataIndex="ID" />
<ext:Column runat="server" Text="Name" DataIndex="Name" Flex="1">
<Editor>
<ext:TextField runat="server" AllowBlank="false" />
</Editor>
</ext:Column>
<ext:NumberColumn runat="server" Text="Salary" DataIndex="Salary" Format="$0,0">
<Editor>
<ext:NumberField runat="server" AllowBlank="false" MinValue="1" MaxValue="150000" />
</Editor>
</ext:NumberColumn>
</Columns>
</ColumnModel>
<Listeners>
<SelectionChange Handler="#{btnRemoveEmployee}.setDisabled(!selected.length) ;" />
</Listeners>
</ext:GridPanel>
<div style="width: 590px; border: 1px solid gray; padding: 5px;">
<ext:Label ID="_lblResult" runat="server" />
</div>
</form>
</body>
</html>

susanz
Feb 05, 2015, 3:58 PM
Thanks Raphael for put this all together! It is a great idea. Instead of showing results out side of the grid, is there a way to show the exclamation mark on the side of the cell and box of message when it is highlighted ?
Thanks
-szhang

RCN
Feb 05, 2015, 4:23 PM
In next few minutes i come up with it.

susanz
Feb 05, 2015, 5:17 PM
no rush, couple days is good for me. Thanks!

RCN
Feb 05, 2015, 10:54 PM
Let me know whether it suits your needs.

20511


<script runat="server">
public class Entity
{
public int ID { get; set; }

public string Name { get; set; }

public float Salary { get; set; }
}

protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
List<Entity> lst = new List<Entity>();

for (int index = 1; index < 16; index++)
{
lst.Add(new Entity
{
ID = index,
Name = string.Format("Name - {0}", index),
Salary = index * 1000
});
}

Store store = this._grd.GetStore();

store.DataSource = lst;

store.DataBind();
}
}
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<script type="text/javascript">

var AnalyzeData = function () {
var grid = App._grd;
var records = grid.getStore().data.map;

for (var recordID in records) {
AnalyzeSalary(records[recordID])
}

grid.getView().refresh();
}

var OnEdit = function (item, e) {
e.record.commit();

AnalyzeSalary(e.record);

App._grd.getView().refresh();
}

var PrepareToolbar = function (grid, toolbar, rowIndex, record) {
var btn = toolbar.items.get(0);
if (!Ext.isEmpty(record.data.Error)) {
btn.setHidden(false);
}
else {
btn.setHidden(true);
}
};

var AnalyzeSalary = function (record) {
record.data.Error = null;
if (record.data.Salary >= 12000) {
record.data.Error = "Contact Chief Human Resources Officer";
}
else if (record.data.Salary >= 8000) {
record.data.Error = "Contact Human Resources";
}
}

var AddEmployee = function () {
var grid = App._grd;

grid.editingPlugin.cancelEdit();

var recordID = grid.getStore().getTotalCount() + 1;

grid.store.add({ ID: recordID, Name: Ext.String.format('Name - {0}', recordID), Salary: recordID * 1000 });

var recordFromStore = grid.getStore().data.map[recordID];

AnalyzeSalary(recordFromStore);

grid.getView().focusRow(recordFromStore);

grid.getSelectionModel().select(recordFromStore);
};

var RemoveEmployee = function () {
var grid = App._grd;
var selectionModel = grid.getSelectionModel();

grid.editingPlugin.cancelEdit();
grid.store.remove(selectionModel.getSelection());
};

</script>
</head>
<body>
<ext:ResourceManager Locale="en" runat="server" />
<ext:GridPanel ID="_grd" Width="600" Height="550" Border="true" Title="Employees" runat="server">
<Store>
<ext:Store AutoLoad="true" runat="server">
<Model>
<ext:Model IDProperty="ID" runat="server">
<Fields>
<ext:ModelField Name="ID" Type="Int" />
<ext:ModelField Name="Name" Type="String" />
<ext:ModelField Name="Salary" Type="Float" />
<ext:ModelField Name="Error" Type="String" />
</Fields>
</ext:Model>
</Model>
<Listeners>
<Load Handler="AnalyzeData();" />
</Listeners>
</ext:Store>
</Store>
<Plugins>
<ext:RowEditing ClicksToMoveEditor="1" AutoCancel="false" runat="server">
<Listeners>
<Edit Fn="OnEdit" />
</Listeners>
</ext:RowEditing>
</Plugins>
<TopBar>
<ext:Toolbar runat="server">
<Items>
<ext:Button Text="Add Employee" Icon="UserAdd" runat="server">
<Listeners>
<Click Fn="AddEmployee" />
</Listeners>
</ext:Button>
<ext:Button ID="btnRemoveEmployee" Text="Remove Employee" Icon="UserDelete" Disabled="true" runat="server">
<Listeners>
<Click Fn="RemoveEmployee" />
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<ColumnModel>
<Columns>
<ext:Column Text="ID" DataIndex="ID" runat="server" />
<ext:Column Text="Name" DataIndex="Name" Flex="1" runat="server">
<Editor>
<ext:TextField AllowBlank="false" runat="server" />
</Editor>
</ext:Column>
<ext:NumberColumn Text="Salary" DataIndex="Salary" Format="$0,0" runat="server">
<Editor>
<ext:NumberField AllowBlank="false" MinValue="1" MaxValue="150000" runat="server" />
</Editor>
</ext:NumberColumn>
<ext:CommandColumn Width="23" runat="server">
<Commands>
<ext:GridCommand CommandName="analysis" Icon="Cross" />
</Commands>
<PrepareToolbar Fn="PrepareToolbar" />
<Listeners>
<Command Handler="Ext.Msg.alert('Information', record.data.Error);" />
</Listeners>
</ext:CommandColumn>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:CheckboxSelectionModel runat="server" Mode="Multi" />
</SelectionModel>
<BottomBar>
<ext:PagingToolbar runat="server" />
</BottomBar>
<Listeners>
<SelectionChange Handler="#{btnRemoveEmployee}.setDisabled(!selected.length) ;" />
</Listeners>
</ext:GridPanel>
</body>
</html>

RCN
Feb 05, 2015, 11:19 PM
Suzanz, if you want to shown the error as tooltip, you can set button's tooltip, as shown below:


var PrepareToolbar = function (grid, toolbar, rowIndex, record) {
var btn = toolbar.items.get(0);
if (!Ext.isEmpty(record.data.Error)) {
btn.setHidden(false);
btn.setTooltip(record.data.Error);
}
else {
btn.setHidden(true);
}
};

And if you do not want to show the error on button's click, please remove CommandColumn's Command listener

RCN
Feb 05, 2015, 11:31 PM
Unfortunately there is an issue with command's tooltip: http://forums.ext.net/showthread.php?53431

susanz
Feb 06, 2015, 2:32 AM
Thanks Raphael, That looks much better! I still have following questions:

1, In my application, there are multiple columns that need this type of Warning check. Instead of showing error on CommandColumn, is there easy way to show the error mark on the target cell ?

**2, How about column summery, how can I validate value on the summary cell using your method?

3, The "Salary" Column name and "1000" amount is hard coded in this example, Is there a good way to make it more dynamic? In my app, the column name & amount are all configured in table.

Thanks for your helps!
-susanz

RCN
Feb 06, 2015, 10:50 AM
Later today i will make the necessary modifications, ok?

susanz
Feb 06, 2015, 4:08 PM
Great! Thank you!

RCN
Feb 06, 2015, 4:15 PM
Do you use MVC or WebForms.

susanz
Feb 06, 2015, 4:26 PM
MVC4 on 2012

RCN
Feb 06, 2015, 4:44 PM
Thanks. I will implement it on MVC.

RCN
Feb 10, 2015, 2:53 PM
Suzanz, sorry for the delay. Later today i am gonna post a full sample, ok?

susanz
Feb 10, 2015, 5:07 PM
No problem. Thanks for working on it!
-sz

RCN
Feb 11, 2015, 2:16 AM
Hello Susanz, sorry for the delay, it has been pretty busy over here.

Tomorrow, in the morning, i will double check to ensure that i haven't missed anything.

Thanks for your patience.

20891


<!DOCTYPE html>
<html>
<head runat="server">
<style type="text/css">
.rowWithError .x-grid-td {
color: white !important;
background-color: red !important;
}
</style>
<script type="text/javascript">

var AnalyzeData = function () {
var grid = App._grd;
var records = grid.getStore().data.map;

for (var recordID in records) {
AnalyzeRecord(records[recordID])
}
}

var ValidateEdit = function (item, e) {
Ext.net.DirectMethod.request({
url: Ext.net.ResourceMgr.resolveUrl("~/Example/ValidateEdit"),
params: {
encodedEntity: item.editor.getValues(false, false, false, true)
},
success: function (resultado) {
e.record.commit();

AnalyzeRecord(e.record);
},
failure: function (result) {
Ext.Msg.alert('Information', result);
}
});
}

var AnalyzeRecord = function (record) {
var grid = App._grd;

if (grid.validatedColumns) {
record.data.Error = null;
for (var index = 0; index < grid.validatedColumns.length; index++) {
var column = grid.validatedColumns[index];

var result = column.validateFn(record.data[column.dataIndex])

if (!Ext.isEmpty(result)) {
if (record.data.Error == null)
{
record.data.Error = result;
}
else
{
record.data.Error = Ext.String.format('{0}<br/>{1}', record.data.Error, result)
}
}
}

var recordIndex = grid.store.data.indices[record.data.ID];
if (!Ext.isEmpty(record.data.Error)) {
grid.getView().addRowCls(recordIndex, "rowWithError");
}
else {
grid.getView().removeRowCls(recordIndex, "rowWithError");
}
}
}

var AddEmployee = function () {
var grid = App._grd;

grid.editingPlugin.cancelEdit();

var recordID = grid.getStore().getTotalCount() + 1;

grid.store.add({ ID: recordID, Name: Ext.String.format('Name - {0}', recordID), Salary: recordID * 1000 });

var recordFromStore = grid.getStore().data.map[recordID];

AnalyzeRecord(recordFromStore);

grid.getView().focusRow(recordFromStore);

grid.getSelectionModel().select(recordFromStore);
};

var RemoveEmployee = function () {
var grid = App._grd;
var selectionModel = grid.getSelectionModel();

grid.editingPlugin.cancelEdit();
grid.store.remove(selectionModel.getSelection());
};

var BeforeShowToolTip = function (toolTip) {
var grid = App._grd;
var view = grid.getView();
var record = view.getRecord(toolTip.triggerElement);

if (!Ext.isEmpty(record.data.Error)) {
toolTip.update(record.data.Error);
return true;
}
else {
return false;
}
};

var IdentifyValidatedColumns = function () {
var grid = App._grd;

var arrValidatedColumns = new Array();

for (var index = 0; index < grid.columns.length; index++) {
var column = grid.columns[index];
if (column.validateFn != null) {
arrValidatedColumns.push(column)
}
}
if (arrValidatedColumns.length > 0) {
grid.validatedColumns = arrValidatedColumns;
}
}

var ValidateName = function (name) {
if (name != null) {
if (Ext.String.startsWith(name, "Ext.Net", true)) {
return "Name cannot start with 'Ext.Net'.";
}
}
return null
}

var ValidateSalary = function (salary) {
if (salary != null) {
if (salary >= 12000) {
return "Contact Chief Human Resources Officer.";
}
else if (salary >= 8000) {
return "Contact Human Resources.";
}
}
return null;
}
</script>
</head>
<body>
<ext:ResourceManager ScriptMode="Debug" Locale="en" runat="server" />
<ext:GridPanel ID="_grd" Width="600" Height="550" Border="true" Title="Employees" runat="server">
<Store>
<ext:Store AutoLoad="true" runat="server">
<Proxy>
<ext:AjaxProxy Url="/Example/LoadFakeRecords/" StartParam="start" LimitParam="limit" PageParam="page" SortParam="sort">
<ActionMethods Read="POST" />
<Reader>
<ext:JsonReader RootProperty="data" />
</Reader>
</ext:AjaxProxy>
</Proxy>
<Model>
<ext:Model IDProperty="ID" runat="server">
<Fields>
<ext:ModelField Name="ID" Type="Int" />
<ext:ModelField Name="Name" Type="String" />
<ext:ModelField Name="Salary" Type="Float" />
<ext:ModelField Name="Error" Type="String" />
</Fields>
</ext:Model>
</Model>
<Listeners>
<Load Handler="AnalyzeData();" />
</Listeners>
</ext:Store>
</Store>
<Plugins>
<ext:RowEditing ClicksToMoveEditor="1" AutoCancel="false" runat="server">
<Listeners>
<ValidateEdit Fn="ValidateEdit" />
</Listeners>
</ext:RowEditing>
</Plugins>
<TopBar>
<ext:Toolbar runat="server">
<Items>
<ext:Button Text="Add Employee" Icon="UserAdd" runat="server">
<Listeners>
<Click Fn="AddEmployee" />
</Listeners>
</ext:Button>
<ext:Button ID="btnRemoveEmployee" Text="Remove Employee" Icon="UserDelete" Disabled="true" runat="server">
<Listeners>
<Click Fn="RemoveEmployee" />
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<ColumnModel>
<Columns>
<ext:Column Text="ID" DataIndex="ID" runat="server" />
<ext:Column Text="Name" DataIndex="Name" Flex="1" runat="server">
<Editor>
<ext:TextField AllowBlank="false" runat="server" />
</Editor>
<CustomConfig>
<ext:ConfigItem Name="validateFn" Value="ValidateName" Mode="Raw" />
</CustomConfig>
</ext:Column>
<ext:NumberColumn Text="Salary" DataIndex="Salary" Format="$0,0" runat="server">
<Editor>
<ext:NumberField AllowBlank="false" MinValue="1" MaxValue="150000" runat="server" />
</Editor>
<CustomConfig>
<ext:ConfigItem Name="validateFn" Value="ValidateSalary" Mode="Raw" />
</CustomConfig>
</ext:NumberColumn>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:CheckboxSelectionModel runat="server" Mode="Multi" />
</SelectionModel>
<BottomBar>
<ext:PagingToolbar runat="server" />
</BottomBar>
<Listeners>
<AfterRender Handler="IdentifyValidatedColumns();" />
<SelectionChange Handler="#{btnRemoveEmployee}.setDisabled(!selected.length) ;" />
</Listeners>
</ext:GridPanel>
<ext:ToolTip
runat="server"
Target="={#{_grd}.getView().el}"
Delegate="={#{_grd}.getView().itemSelector}"
TrackMouse="true">
<Listeners>
<BeforeShow Fn="BeforeShowToolTip" />
</Listeners>
</ext:ToolTip>
</body>
</html>



namespace SandBox.Controllers
{
public class ExampleController : System.Web.Mvc.Controller
{
public ActionResult Index()
{
return View();
}

public StoreResult LoadFakeRecords(int start, int limit, int page, string sort)
{
List<Entity> lst = new List<Entity>();

for (int index = start; index < (page * limit); index++)
{
lst.Add(new Entity
{
ID = index,
Name = string.Format("Name - {0}", index),
Salary = index * 1000
});
}

return new StoreResult(lst, (page * limit) + limit);
}

public AjaxResult ValidateEdit(string encodedEntity)
{
AjaxResult result = new AjaxResult();

Entity entity = JSON.Deserialize<Entity>(encodedEntity);

if(entity.Salary > 50000)
{
result.ErrorMessage = "The salary cannot be greater than 50,0000";
}

return result;
}
}

public class Entity
{
public int ID { get; set; }

public string Name { get; set; }

public float Salary { get; set; }
}
}

RCN
Feb 11, 2015, 2:19 AM
Let me know whether you need further assistance.

RCN
Feb 11, 2015, 2:32 AM
In addition, if you replace AnalyzeRecord by the following:


var AnalyzeRecord = function (record) {
var grid = App._grd;

if (grid.validatedColumns) {
record.data.Error = null;
for (var index = 0; index < grid.validatedColumns.length; index++) {
var column = grid.validatedColumns[index];

var result = column.validateFn(record.data[column.dataIndex])

if (!Ext.isEmpty(result)) {
record.data.Error = Ext.String.format('{0}<li>{1}</li>', record.data.Error, result)
}
}

var recordIndex = grid.store.data.indices[record.data.ID];
if (!Ext.isEmpty(record.data.Error)) {

record.data.Error = Ext.String.format('<b>Erro(s):</b></br /><ul>{0}</ul>', record.data.Error)

grid.getView().addRowCls(recordIndex, "rowWithError");
}
else {
grid.getView().removeRowCls(recordIndex, "rowWithError");
}
}
}


You get the following result

20901

susanz
Feb 11, 2015, 8:51 PM
Hi Raphael, Thank you so much for providing such detail implementations! I got your sample working on my machine. It is very flexible design that fit most of my needs. Couple things still need your helps:

1, After "Update" from Row editor, the "rowWithError" class is no longer there. I tried to use ValidateEdit listener to call AnalyzeRecord(e.record) but looks like the "rowWithError" is removed again after this call. Any other point that I can call AnalyzeRecord(record) to reisntall row class after Update Row. ?

2, Will this work on group summery row ?

I will be working for other proj for 1-2 weeks. So please take your time, no rush.

Thanks again!
-szhang

RCN
Feb 11, 2015, 9:09 PM
1, After "Update" from Row editor, the "rowWithError" class is no longer there. I tried to use ValidateEdit listener to call AnalyzeRecord(e.record) but looks like the "rowWithError" is removed again after this call. Any other point that I can call AnalyzeRecord(record) to reisntall row class after Update Row. ?

Can you list the steps?


2, Will this work on group summery row ?
I am gonna review. Suzanz, do you need to show any information in group summary? Please, if possible, expand on that.

RCN
Feb 11, 2015, 9:17 PM
I will be working for other proj for 1-2 weeks. So please take your time, no rush.

For me and on behalf of Ext.Net Team i would like to say that it is a pleasure to assist you and the Ext.Net Community as fast as we can.

Let us know anytime you need assistance.

susanz
Feb 11, 2015, 9:26 PM
Can you list the steps?

1, click a row to edit, change name to "Ext.Net Name xx"
2, click update to commit.
3, the red color is not on the updated row.

Can you reproduce? I changed one line in your AnalyzeRecord(), hope that is not the reason.


var recordIndex = grid.store.getById(record.data.ID).index; // grid.store.data.indices[record.data.ID]; -- this line give me undefined error


This is my ValidateEdit JS:


var validateEdit = function (editor, e) {
AnalyzeRecord(e.record);
}




I am gonna review. Do you need sample?

I'd prefer to have sample. Thanks
-szhang

RCN
Feb 12, 2015, 10:54 AM
Suzanz, you missed the following:


I am gonna review. Suzanz, do you need to show any information in group summary? Please, if possible, expand on that.

susanz
Feb 12, 2015, 4:01 PM
I am gonna review. Suzanz, do you need to show any information in group summary? Please, if possible, expand on that.
This is our requiment on group summary:

1, For all groupable columns (dynamic), if the validation is defined for this group summary, warning need to be displayed on load, on grouping and on summary value changes.

2, Group validation will compare the total against a value defined in table. example: The total salary cannot be grater than $1000000. similar to the cell validation.

Let me know if you need more info.
Thanks
-szhang

RCN
Feb 12, 2015, 4:17 PM
Thank you.

Daniil
Feb 17, 2015, 1:55 PM
It looks like quite a bunch of questions have been already answered in this thread. I am closing the thread.

@susanz, if some questions are still not covered, please start a new forum thread for each. Please keep one specific issue per thread. Also please feel free to cross-reference between the threads if you feel they are related.

susanz
Feb 19, 2015, 9:14 PM
Hi Raphael, Sorry to see this is closed. I am going to open another thread "Dynamically show warning message on summary column" and hope you could show me how to do it there. Thanks -szhang