EditorGridPanel验证小问题,谢谢!

当我在EditorGridPanel新增列后,我不输入任何数据,马上点击保存,但是我不知道用什么方法来提示必须输入数据呢?

使用grid.getView().getCell(row,column)firstChild.innerText取值

如: var value = grid.getView().getCell(行号,
列号).firstChild.innerText; //获得grid中指定位置的值

然后判断是否为空,这里有时需要去掉空格后再判断
if(value == '') alert('不能为空'); return;

validateedit这个方法,你找找看

你说的是增加新行吧?
自已判断一下是否有数据,然后出提示:
var selectedRow =youeGrid.getSelectionModel().getSelected();
if(selectedRow && selectedRow.get("id") > 0) {
Ext.MessageBox.alert('警告', '....');
}
就行了。