* selectRows(rows, keepExisting): 选择数组rows中指定的行(索引),参数keepExisting为true保留原先选择的行,为false则清除原来选择的行
* selectRange(startRow, endRow, keepExisting): 选择从startRow开始到endRow结束的行,参数keepExisting为true保留原先选择的行,
* 为false则清除原来选择的行
* deselectRow(index): 不选指定的索引的行
* deselectRange(startRow,endRow): 不选从startRow开始到endRow结束的行
* getCount(): 返回选择的行数
*
* 示例如下:
*
*/
/**
* Ext.onReady(function(){
//启用悬停提示
Ext.QuickTips.init();
//列模型
var cm = new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer(),
{header: "姓名", width: 80, dataIndex: "Name", tooltip: "这是您的姓名"},
{
header: "性别",
width: 40,
dataIndex: "Sex",
align: "center",
renderer: function(v){
if(v == "男"){
return "<img src='../img/drop-yes.gif'>"
}
return "<img src='../img/drop-no.gif'>"
}
},
{
header: "生日",
width: 150,
format: "Y-m-d",
dataIndex: "Birthday",
renderer: Ext.util.Format.dateRenderer("Y-m-d")
},
{header: "学历", width: 80, dataIndex: "Education", align: "center"},
{id: "memo", header: "备注", dataIndex: "Memo"},
{
header: "操作",
width: 150,
dataIndex: "",
menuDisabled: true,
renderer: function(v){
return "<span style='margin-right: 10px'><a href='#'>修改</a></span><span><a href='#'>删除</a></span>";
}
}
]);
//准备数据
var data = [
{
name: "李赞红",
sex: "男",
birthday: Date.parseDate("1979-04-11", "Y-m-d"),
edu: "本科",
memo: "无备注"
},
{
name: "陈南",
sex: "男",
birthday: Date.parseDate("1987-08-06", "Y-m-d"),
edu: "本科",
memo: "一个小帅哥哈"
},
{
name: "易珊静",
sex: "女",
birthday: Date.parseDate("1980-05-12", "Y-m-d"),
edu: "本科",
memo: "无备注"
},
{
name: "张海军",
sex: "男",
birthday: Date.parseDate("1980-12-11", "Y-m-d"),
edu: "本科",
memo: "无备注"
},
];
?
详细解决方案
ext_GridPanel2_二
热度:252 发布时间:2013-11-22 23:06:19.0
相关解决方案