我正在实现一个网格面板,其中最后四列可编辑为大多数行.问题是我希望能够禁用编辑,假设第一个如果record.get('status')= 4,那么最终确定并且只有两列可以编辑.
有没有办法禁用显示这些行的编辑?我可以使用CellEditing来做,但想继续使用RowEditing插件.
此致,克里斯蒂安
有没有办法将ExtJS(版本4)ComboBox的下拉菜单的宽度设置为宽于实际输入框的宽度?
我有一个comboxbox,我希望大约200px,但我在结果下拉列表上分页,宽度甚至不足以显示所有分页栏的控件.
这是我创建组合的代码:
var add_combo = Ext.create('Ext.form.field.ComboBox',
{
id : 'gbl_add_combo',
store : Ext.create('Ext.data.Store',
{
remoteFilter : true,
fields : ['gb_id', 'title'],
proxy :
{
type : 'ajax',
url : 'index.php/store/get_items',
reader :
{
type : 'json',
root : 'records',
totalProperty : 'total',
successProperty : 'success'
},
actionMethods :
{
read : 'POST',
create : 'POST',
update : 'POST',
destroy : 'POST'
}
}
}),
listConfig:
{
loadingText: 'Searching...',
emptyText: 'No results found'
},
queryMode : 'remote',
hideLabel : true, …Run Code Online (Sandbox Code Playgroud) 有人可以帮助我如何使用extjs版本4扩展extjs组件.我正在寻找相同的正确语法.请帮忙..!!
当我应该使用initComponent比较constructor?
我一直在使用initComponent来扩展我的对象,但查看Ext.define的文档是使用构造函数来查看它们然后放置.有什么不同?
相比:
Ext.define('My.app.PanelPart2', {
extend: 'My.app.Panel',
constructor: function (config) {
this.callSuper(arguments); // calls My.app.Panel's constructor
//...
}
});
Run Code Online (Sandbox Code Playgroud)
至
Ext.define('My.app.PanelPart2', {
extend: 'My.app.Panel',
initComponent: function (config) {
Ext.apply(this, config);
this.callParent(arguments);
}
});
Run Code Online (Sandbox Code Playgroud)
我知道有些组件没有初始化(我正在看着你Ext.data.Store),这导致我只倾向于编写构造函数,因为这应该是通用的.
我有一个组合框,forceSelection配置设置为true.
组合框是可选的.它可以是空的.
如果用户选择其中一个选项,然后重新清空组合框,则不希望为空.
组合框始终会恢复以前选择的值.
这太荒谬了.用户删除值时应为空.
如何解决这个问题呢?我错过了配置吗?
我一直试图找出Ext JS 4中的要求,我似乎无法得出一个合理的答案.假设我有以下代码:
app.js
Ext.Loader.setConfig({
enabled: true
});
Ext.Loader.setPath('Ext.ux', 'examples/ux');
Ext.application({
name: 'Test',
appFolder: 'app',
controllers: ['TheController'],
requires: ['Test.Utils', 'Test.Utils2'], // I don't think this does anything... couldn't find this option for Ext.application
launch: function() {
Ext.create('Ext.Viewport', {
layout: 'border',
items: [{
xtype: 'thegrid',
region: 'center',
title: 'blah!'
}]
});
}
});
Run Code Online (Sandbox Code Playgroud)
应用程序/控制器/ TheController.js
Ext.define('Test.controller.TheController', {
extend: 'Ext.app.Controller',
models: ['TheModel'],
stores: ['TheStore'],
views: ['TheGrid'],
init: function() {
}
});
Run Code Online (Sandbox Code Playgroud)
应用程序/视图/ TheGrid.js
Ext.define('Test.view.TheGrid', {
extend: 'Ext.grid.Panel',
alias: 'widget.thegrid',
requires: ['Test.store.TheStore'],
store: …Run Code Online (Sandbox Code Playgroud) 我有一个面板,我从服务器插入一些HTML:
myPanel.update(response.responseText);
Run Code Online (Sandbox Code Playgroud)
但是如果此文本太大,则不会出现导航文本的滚动条.
如何在此面板中配置垂直滚动条?
谢谢.
更新:
这是我的面板定义:
{
xtype:'panel',
width: '100%',
height: 300,
id:'mypanel'
},
Run Code Online (Sandbox Code Playgroud) 我在Extjs4 librairie上遇到了一些问题.我想使用treeEditor组件.
Firebug错误:
错误:未捕获的异常:未启用Ext.Loader,因此无法动态解析依赖项.缺少必需的类:Ext.tree.TreeNode
我的代码:
Ext.require([
'Ext.form.*',
'Ext.grid.*',
'Ext.tree.*',
'Ext.data.*',
'Ext.util.*',
'Ext.loader.*',
'Ext.state.*',
'Ext.layout.container.Column',
'Ext.tab.TabPanel'
]);
Ext.onReady(function(){
// shorthand
Ext.QuickTips.init();
var tree = Ext.create('Ext.tree.TreePanel', {
animate:false,
enableDD:false,
// loader: new Tree.TreeLoader(), // Note: no dataurl, register a TreeLoader to make use of createNode()
lines: true,
rootVisible:false,
// selModel: new Ext.tree.MultiSelectionModel(),
containerScroll: false
});
// set the root node
var root = Ext.create('Ext.tree.TreeNode',{
text: 'Autos',
draggable:false,
id:'source'
});
tree.on('contextmenu',showCtx);
tree.on('click',function(node,e){node.select();return false;});
// json data describing the tree
var json = [ …Run Code Online (Sandbox Code Playgroud) 既然ExtJS 4已经摆脱了ColumnModel对象,那么如何将默认配置选项应用于网格中的所有列?
我有一个ExtJs的问题combobox,考虑我有一个combobox有4个项目和select事件中的回调函数combobox.
当我要设置combobox所选值时setValue(),ExtJs不会触发select事件.
我该如何解决这个问题?
我应该自己解雇这个事件setValue()吗?