Ext.grid.panel的默认表头下拉菜单是这个样子的 我想要这个样子的 也就是把英文的文字改成中文,根据网上的资料应该这样改
viewConfig:{
columnsText:"显示/隐藏列",
sortAscText:"正序排列",
sortDescText:"倒序排列",
forceFit:true
}不过在我的项目里没效果,我按 sortAscText 搜索了ext-all.js发现了这个/**
* Container which holds headers and is docked at the top or bottom of a TablePanel.
* The HeaderContainer drives resizing/moving/hiding of columns within the TableView.
* As headers are hidden, moved or resized the headercontainer is responsible for
* triggering changes within the view.
*/
Ext.define('Ext.grid.header.Container', {
extend: 'Ext.container.Container',
requires: [
'Ext.grid.ColumnLayout',
'Ext.grid.plugin.HeaderResizer',
'Ext.grid.plugin.HeaderReorderer'
],
uses: [
'Ext.grid.column.Column',
'Ext.menu.Menu',
'Ext.menu.CheckItem',
'Ext.menu.Separator'
],
border: true, alias: 'widget.headercontainer', baseCls: Ext.baseCSSPrefix + 'grid-header-ct',
dock: 'top', /**
* @cfg {Number} weight
* HeaderContainer overrides the default weight of 0 for all docked items to 100.
* This is so that it has more priority over things like toolbars.
*/
weight: 100, defaultType: 'gridcolumn',
detachOnRemove: false, /**
* @cfg {Number} defaultWidth
* Width of the header if no width or flex is specified.
*/
defaultWidth: 100,
/**
* @cfg {Boolean} [sealed=false]
* Specify as `true` to constrain column dragging so that a column cannot be dragged into or out of this column.
*
* **Note that this config is only valid for column headers which contain child column headers, eg:**
* {
* sealed: true
* text: 'ExtJS',
* columns: [{
* text: '3.0.4',
* dataIndex: 'ext304'
* }, {
* text: '4.1.0',
* dataIndex: 'ext410'
* }
* }
*
*/ //<locale>
sortAscText: 'Sort Ascending',
//</locale>
//<locale>
sortDescText: 'Sort Descending',
//</locale>
//<locale>
sortClearText: 'Clear Sort',
//</locale>
//<locale>
columnsText: 'Columns',
//</locale>
可以看到这个Ext.grid.header.Container类里有那个配置项,不过在api里没有显示,也查不到。
所以现在好迷茫,要怎么把我的表头下拉菜单里的排序啊 分组啊 提示文字改成中文的extjs4gridsortAscText
viewConfig:{
columnsText:"显示/隐藏列",
sortAscText:"正序排列",
sortDescText:"倒序排列",
forceFit:true
}不过在我的项目里没效果,我按 sortAscText 搜索了ext-all.js发现了这个/**
* Container which holds headers and is docked at the top or bottom of a TablePanel.
* The HeaderContainer drives resizing/moving/hiding of columns within the TableView.
* As headers are hidden, moved or resized the headercontainer is responsible for
* triggering changes within the view.
*/
Ext.define('Ext.grid.header.Container', {
extend: 'Ext.container.Container',
requires: [
'Ext.grid.ColumnLayout',
'Ext.grid.plugin.HeaderResizer',
'Ext.grid.plugin.HeaderReorderer'
],
uses: [
'Ext.grid.column.Column',
'Ext.menu.Menu',
'Ext.menu.CheckItem',
'Ext.menu.Separator'
],
border: true, alias: 'widget.headercontainer', baseCls: Ext.baseCSSPrefix + 'grid-header-ct',
dock: 'top', /**
* @cfg {Number} weight
* HeaderContainer overrides the default weight of 0 for all docked items to 100.
* This is so that it has more priority over things like toolbars.
*/
weight: 100, defaultType: 'gridcolumn',
detachOnRemove: false, /**
* @cfg {Number} defaultWidth
* Width of the header if no width or flex is specified.
*/
defaultWidth: 100,
/**
* @cfg {Boolean} [sealed=false]
* Specify as `true` to constrain column dragging so that a column cannot be dragged into or out of this column.
*
* **Note that this config is only valid for column headers which contain child column headers, eg:**
* {
* sealed: true
* text: 'ExtJS',
* columns: [{
* text: '3.0.4',
* dataIndex: 'ext304'
* }, {
* text: '4.1.0',
* dataIndex: 'ext410'
* }
* }
*
*/ //<locale>
sortAscText: 'Sort Ascending',
//</locale>
//<locale>
sortDescText: 'Sort Descending',
//</locale>
//<locale>
sortClearText: 'Clear Sort',
//</locale>
//<locale>
columnsText: 'Columns',
//</locale>
可以看到这个Ext.grid.header.Container类里有那个配置项,不过在api里没有显示,也查不到。
所以现在好迷茫,要怎么把我的表头下拉菜单里的排序啊 分组啊 提示文字改成中文的extjs4gridsortAscText
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货