View Full Version : [CLOSED] Field validation inside cellediting gridpanel

Jul 11, 2014, 3:13 PM
How to validate fields inside gridpanel with client side scripting ,fields inside editor.


.CustomConfig(cc => cc.Add(new ConfigItem { Name = "initQuery", Value = "Ext.emptyFn", Mode = ParameterMode.Raw }))

Jul 11, 2014, 5:01 PM
Hi @matrixwebtech,

Please describe what exactly you would like to do.

Do you mean that AllowBlank="false" is not working? It appears to be working for me.

Jul 11, 2014, 6:18 PM
Hi daniil

please look http://forums.ext.net/showthread.php?39211-CLOSED-Load-combobox-dynamically-inside-gridpanel-editorfield

here I design a gridpanel(on 1st post) with editor.I want to validate each field of each row on save button click.
I use allowblank = false but its not working on save button click then i write bellow script

.Listeners(l => l.Click.Handler = "return validation();")

<script type="text/javascript">
var validation = function () {

var grid = App.GridPanel1;
var j=0
grid.getStore().each(function (item) {
//var json = JSON.parse(item.data);
j = j + 1;
var row = item.data,

for (column in row) {
if (row.hasOwnProperty(column)) {
//console.log(column + " = " + row[column]);
if (length(row[column]) <= 0 || row[column] == "0") {
Ext.MessageBox.alert("Fill all field at row "+ j);



its validate the store but I not able to set a error message against the particular field which is blank and set focus to this control.can you please suggest me a best way to do this?

Jul 12, 2014, 9:22 AM
A Column shares its Editor for all the rows. It means that there is the only ComboBox for all the rows. So, you won't be able to show an individual ComboBox for several rows of the same Column. I would say there is no built-in functionality to demonstrate visually the validation errors in a GridPanel. I would suggest you to try with a Column's Renderer. If a cell's value is not valid, then show an error in the cell.

but I not able to set a error message against the particular field which is blank and set focus to this control.

You could start editing programmatically on the cell of the specific row and column. The shown editor field should be validated according to its validation settings.

Jul 12, 2014, 1:21 PM
can you please some example of Column's Renderer

Jul 12, 2014, 7:59 PM
I would say there is a Renderer used in the most of our GridPanel examples.