ExtJs Gridpanel选择模式 [英] ExtJs Gridpanel selection modal

查看:79
本文介绍了ExtJs Gridpanel选择模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个问题:

  1. 如何将ExtJs网格面板中的第一行设置为选中状态,并且
  2. 如何编写单独的JS文件以对电话号码和日期字段等进行自定义验证

预先感谢

推荐答案

假设您有网格实例,则可以使用selectFirstRow()选择该行.这是示例代码:

Assuming you have an instance of your grid, you can select the row using selectFirstRow(). Here is the sample code:

grid.getSelectionModel().selectFirstRow();

您可以将自定义验证移至另一个文件.所有您需要移动的

You can move your custom validations to another file. All you need to move your

Ext.apply(Ext.form.VTypes, {
    daterange : function(val, field) {
        var date = field.parseDate(val);
        ...
    }
});

分隔文件.并确保包含js文件.

to separate file. and ensure that the js file is included.

这篇关于ExtJs Gridpanel选择模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆