<!DOCTYPE HTML PUBLIC "-//W<chmetcnv unitname="C" sourcevalue="3" hasspace="False" negative="False" numbertype="1" tcsc="0" w:st="on">3C</chmetcnv>//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>动态修改combobox选择项例子</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css">
</head>
<body>
<script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../../ext-all.js"></script>
<script type="text/javascript" src="../../ext-lang-zh_CN.js"></script>
<script>
Ext.onReady(function(){
Ext.QuickTips.init();
var root = new Ext.tree.TreeNode({
text: '选项',
allowDrag:false,
allowDrop:false
});
root.appendChild(
new Ext.tree.TreeNode({id:1,text:'选项一',allowDrag:false}),
new Ext.tree.TreeNode({id:2,text:'选项二',allowDrag:false}),
new Ext.tree.TreeNode({id:3,text:'选项三',allowDrag:false}),
new Ext.tree.TreeNode({id:4,text:'选项四',allowDrag:false})
);
var tree=new Ext.tree.TreePanel({
style:'margin:20px 0 0 20px',
title:'选项列表',
width: 200,
height:300,
root:root
})
tree.render(document.body);
root.expand();
var combo=new Ext.form.ComboBox({
valueField :"id",
displayField: "text",
store:new Ext.data.SimpleStore({
fields: ["id", "text"],
data: []
}),
mode: 'local',
blankText:'请选择',
emptyText:'请选择',
hiddenName:'testhide',
fieldLabel: '测试',
name: 'test',
anchor:'90%'
})
var simpleForm = new Ext.FormPanel({
labelAlign: 'left',
title: '动态修改combobox选择项例子',
buttonAlign:'center',
bodyStyle:'padding:5px',
style:'margin:20px 0 0 20px;',
width: 600,
frame:true,
labelWidth:80,
items: [combo],
buttons:[{
text:'改变选项',
handler:function(){
var data=[];
combo.clearValue();
for(var i=0;i<root.childNodes.length;i++){
var node=root.childNodes[i];
data.push([node.id,node.text]);
}
combo.store.loadData(data);
}
}]
});
simpleForm.render(document.body);
});
</script>
</body>
</html>
|
相关推荐
全部代码 注意路径 博文链接:https://avs110.iteye.com/blog/1156428
用Ext 2.0 combobox 做的省份和城市联动选择框的例程
Ext 异步加载添加 删除节点 修改combobox选择项,相当好的东西,值得参考!希望对你有用!
1.3. 看看ext-2.0的文档 1.4. 为什么有的例子必须放在服务器上才能看到效果? 1.5. 为什么自己按照例子写的代码,显示出来总找不到图片 1.6. 我们还需要什么? 1.7. 入门之前,都看helloworld。 1.7.1. 直接使用下载...
Ext.form.field.ComboBox结合Java、JSON实现AutoComplete
ext,ext combobox,ext二级联动,ext combobox二级联动 ___本人的原则:上传好东西,但绝不便宜.因为自己的心血 ext combobox二级联动,ext ,ext combobox,combobox,combobox二级联动,ext 二级联动 groupCombo.on('...
用EXT来实现下拉框ComboBox 下拉框可以实现分页
基于Ext3.4的一个扩展Combobox组件
直接放到tomcat下.访问iconcombo.html页面 用的的文件名称如下:iconcombo.html js/Ext.ux.IconCombo.js css/Ext.ux.IconCombo.css
Ext中的Combobox下来框在EditGrid中的应用。Combobox显示值问题得以解决。
ext关于form表单和combobox的例子
DataGrid动态绑定ComboBox <DataGridComboBoxColumn.EditingElementStyle>
该资源是war包,里面包括ComboBox中的各个参数, 详细讲解在我的文档中有
NULL 博文链接:https://zhcl321.iteye.com/blog/1317526
Ext动态换皮肤 1、在页面中增加一个放样式文件的地方: <link rel="stylesheet" type="text/css" href="ext/2.0/resources/css/ext-all.css" /> <script type="text/javascript" src="ext/2.0/adapter/ext/ext-...
自定义ComboBox,实现指定项不可选择。 只要添加项的标题中含有字符串(*),该项即变为灰色斜体,不可选择。 若强行选择该项,系统会自动搜索临近可用项。 使用方法: com.Item.Add("不可选项 *"); ...
VS2008编写的Combobox控件下拉列表中某些项不可选呈现灰色背景,可以选择的项正常背景
extjs editgrid combobox 回显extjs editgrid combobox 回显extjs editgrid combobox 回显extjs editgrid combobox 回显
NULL 博文链接:https://dengli19881102.iteye.com/blog/1046190