加分! Extjs5.0版本中Ext.grid.property.Grid组件去除默认排序问题
Ext.grid.property.Grid组件的默认排序方式是在哪里定义的,如何能够用靠谱的方法去屏蔽它的默认排序方式有实操经验的朋友欢迎您的热情回答!没有实际操作经验...
Ext.grid.property.Grid组件的默认排序方式是在哪里定义的,如何能够用靠谱的方法去屏蔽它的默认排序方式
有实操经验的朋友欢迎您的热情回答!没有实际操作经验的朋友请勿打扰. 展开
有实操经验的朋友欢迎您的热情回答!没有实际操作经验的朋友请勿打扰. 展开
1个回答
展开全部
你是想让那一列不允许排序么?列属性里有个sortable,新建的时候设为false
比如
Ext.create('Ext.data.Store', {
storeId:'employeeStore',
fields:['firstname', 'lastname', 'seniority', 'dep', 'hired'],
data:[
{firstname:"Michael", lastname:"Scott", seniority:7, dep:"Management", hired:"01/10/2004"},
{firstname:"Dwight", lastname:"Schrute", seniority:2, dep:"Sales", hired:"04/01/2004"},
{firstname:"Jim", lastname:"Halpert", seniority:3, dep:"Sales", hired:"02/22/2006"},
{firstname:"Kevin", lastname:"Malone", seniority:4, dep:"Accounting", hired:"06/10/2007"},
{firstname:"Angela", lastname:"Martin", seniority:5, dep:"Accounting", hired:"10/21/2008"}
]
});
Ext.create('Ext.grid.Panel', {
title: 'Column Demo',
store: Ext.data.StoreManager.lookup('employeeStore'),
columns: [
{text: 'First Name', dataIndex:'firstname',sortable:false},
{text: 'Last Name', dataIndex:'lastname'},
{text: 'Hired Month', dataIndex:'hired', xtype:'datecolumn', format:'M'},
{text: 'Department (Yrs)', xtype:'templatecolumn', tpl:'{dep} ({seniority})'}
],
width: 400,
forceFit: true,
renderTo: Ext.getBody()
});
比如
Ext.create('Ext.data.Store', {
storeId:'employeeStore',
fields:['firstname', 'lastname', 'seniority', 'dep', 'hired'],
data:[
{firstname:"Michael", lastname:"Scott", seniority:7, dep:"Management", hired:"01/10/2004"},
{firstname:"Dwight", lastname:"Schrute", seniority:2, dep:"Sales", hired:"04/01/2004"},
{firstname:"Jim", lastname:"Halpert", seniority:3, dep:"Sales", hired:"02/22/2006"},
{firstname:"Kevin", lastname:"Malone", seniority:4, dep:"Accounting", hired:"06/10/2007"},
{firstname:"Angela", lastname:"Martin", seniority:5, dep:"Accounting", hired:"10/21/2008"}
]
});
Ext.create('Ext.grid.Panel', {
title: 'Column Demo',
store: Ext.data.StoreManager.lookup('employeeStore'),
columns: [
{text: 'First Name', dataIndex:'firstname',sortable:false},
{text: 'Last Name', dataIndex:'lastname'},
{text: 'Hired Month', dataIndex:'hired', xtype:'datecolumn', format:'M'},
{text: 'Department (Yrs)', xtype:'templatecolumn', tpl:'{dep} ({seniority})'}
],
width: 400,
forceFit: true,
renderTo: Ext.getBody()
});
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询