- <link rel="stylesheet" type="text/css" href="resources/css/ext-all.css">
- <link rel="stylesheet" type="text/css" href="css/ext-patch.css">
1
|
Ext.get(
'iframe1'
).dom.contentWindow.document.body.innerHTML=html;
|
collapsible:true, //必须有collapsed:true, //true为收起,flase为展开( 默认 )
6、Ext.form.ComboBox() 每条记录中存放并获取多个值grid.expand(true); //展开grid.collapse(true);//收起
7、动态隐藏Grid的列var reader = new Ext.data.JsonReader(
{root:'list'},
[
{name : 'id'}, //真实值
{name : 'name'}, //显示值
{name : 'status'} //新增的状态值,用于判断的,可以自己添加多个
]
);var store=new Ext.data.Store({
proxy : new Ext.data.HttpProxy({
url : 'url.json'
}),
baseParams : {
varName:'varValue',varName:'varValue',
},
reader: reader
});
store.load();
var comboBox = new Ext.form.ComboBox ({
fieldLabel : "==请选择==",
id: "comboBox",
anchor: '40%',
store: store,
displayField: 'name',
valueField: 'id',
triggerAction: 'all',
mode: 'local',
typeAhead: true,
editable: true,
selectOnFocus: true,
listeners :{
select: function(record){
console.log(record);//对于Ext.form.ComboBox的属性:selectedIndex在API中并不存在,不过此属性的确存在于源码中;
comboBox.getStore().getAt(comboBox.selectedIndex).data.status;
}
}
});
this.getResponse().setContentType("text/html;charset=UTF-8");
Content-Type对浏览器解析的一些影响
var
searchtitle=document.getElementById(
'search_text_2'
).value;
Ext.getCmp(
"mainPanel"
).add({
title:searchtitle,
id:searchtitle,
closable:
true
,
bodyStyle:
"background:url(img/xuancai2.jpg); border-width: 0px 2px 0px 0px;"
,
html:
'<iframe scrolling="auto" frameborder="0" width="100%" height="100%" src=second.jsp?fortitle='
+searchtitle+
'></iframe>'
});
|
mainPanel是个tabPanel,增加个子panel,并在子panel中嵌入iframe,search_text_2是个搜索框,iframe的src属性直接把搜索框的值传给下一个页面。下一个页面通过下面一行代码得到上一个界面搜索框的值。
|
String sendtitle=request.getParameter(
"fortitle"
);
|
var t
function timedCount()
{
t=setTimeout("timedCount()",600000);
store.reload();
}
14、FormPanel重置。显示窗口要写在formpael加载当前record之前,不然addForm.getForm().reset();无效,窗口中会仍有你加载的record。
addWindow.show(); // 显示窗口addForm.getForm().loadRecord(record);15、遍历Tree并且高亮显示节点(递归)var rootnodes = areaTree.getRootNode().childNodes; findchildnode(areaTree.getRootNode().childNodes,textValue);function findchildnode(nodes,textValue){ for(var i=0;i<nodes.length;i++){ var rootnode = nodes[i]; rootnode.expand(); console.log(rootnode.text.toLowerCase()); var el = rootnode.getUI().getEl(); Ext.id(el); var eldoc = Ext.Element.fly(el); if(rootnode.text.toLowerCase().indexOf(textValue)>=0){ console.log(el); eldoc.highlight('CCFF66',{ attr: 'background-color', duration: 60 }); }else{ eldoc.highlight('FFFFFF',{ attr: 'background-color', duration: 60 }); } if(rootnode.childNodes.length>0){ findchildnode(rootnode.childNodes,textValue); } } }
| |||||||||||||||||
|
|