[java]代码库
Ext.define('voole.view.vrm.cpManage.CpManage',{
extend: 'Ext.panel.Panel',
alias:'widget.cpManage_view_alias',
store:'vrm.cpManage.CpManageStore',
layout:'border',
split: true,
initComponent: function() {
//内容提供商的类型
var cptype_store= voole.biz.service.Dict.getDictStore("cptype",false);
cptype_store.load();
var isnotsync_store =voole.biz.service.Dict.getDictStore("isnotsync",false);
isnotsync_store.load();
var needauth_store =voole.biz.service.Dict.getDictStore("needauth",false);
needauth_store.load();
var synctype_store =voole.biz.service.Dict.getDictStore("synctype",false);
synctype_store.load();
//render 的时候用于调用keyname------------------------------------
var getkeyname =function(value,render_arr){
for(var k = 0; k < render_arr.length; k++){
if(render_arr.items[k]["data"]['keyvalue'] == value){
return render_arr.items[k]["data"]['keyname'];
}
}
return '';
}
this.items=[
{
xtype:'panel',
region: 'center',
layout:"border",
split: true,
items:[
{//查询区域
xtype:"form",
title:'查询区域',
id:'cmManage_form_find_id',
layout:'column',
collapsible: true,
region:"north",
frame:true,
height:80,
defaults: { // defaults 将会应用所有的子组件上,而不是父容器
labelWidth:90,
width:190,
xtype:'textfield'
},
items:[
{
fieldLabel:'内容提供商编号',
name : 'cpid',
xtype: 'textfield',
width: 180,
allowBlank: true
},
{
fieldLabel:'内容提供商名称',
name : 'cpname',
xtype: 'textfield',
width: 180,
allowBlank: true
},
{
xtype: 'combo',
editable:false,
width:240,
name : 'cptype',
fieldLabel: '内容提供商类型',
id:'find_cplistby_cptype',
displayField :'keyname',
valueField:'keyvalue',
emptyText:'请选择内容提供商类型',
store:cptype_store,
queryMode: 'local'
} ,{
id:'find_cpManageby',
xtype: 'button',
width: 60,
text:'查询'
},
{
name : 'rst01',
xtype: 'button',
width: 60,
text:'重置',
handler: function(){
Ext.getCmp("cmManage_form_find_id").getForm().reset();
}
} ]
},{//表格-----------------------------------
xtype:'gridpanel',
id:'cpManage_grid',
region: 'center',
store:'vrm.cpManage.CpManageStore',
defaults: { // defaults 将会应用所有的子组件上,而不是父容器
autoScroll: true,
align:'center'
},
border:1,multiSelect: true,frame:true,selModel:{selType:'checkboxmodel'},
tbar: [
{ xtype: 'button', text: '增加' ,iconCls:'grid-add',action:"cpManage_add",id:'cp_info_add',disabled:true},
{ xtype: 'button', text: '修改' ,iconCls:'grid-mif',action:"cpManage_modify",id:'cp_info_edit',disabled:true},
{ xtype: 'button', text: '删除' ,iconCls:'grid-delete',action:"cpManage_delete",id:'cp_info_del',disabled:true},
{ xtype: 'button', text: '内容同步任务' ,iconCls:'grid-mif',action:"cpManage_syncjobs",id:'cp_info_syncjobs',disabled:true}
],
columns:[
{header: "seqno", width: 120, dataIndex: 'seqno', sortable: true,hidden: true},
{header: "内容提供商编号", width: 100, dataIndex: 'cpid', sortable: true},
{header: "内容提供商名称", width: 100, dataIndex: 'cpname', sortable: true},
{header: "内容商英文名称", width: 100, dataIndex: 'cpenname', sortable: true},
{header: "内容商类型", width: 100, dataIndex: 'cptype', sortable: true, renderer:function(value){return getkeyname(value,cptype_store.data)}},
{header: "内容商简介", width: 100, dataIndex: 'cpintro', sortable: true},
{header: "联系人", width: 100, dataIndex: 'contact', sortable: true},
{header: "联系地址", width: 100, dataIndex: 'address', sortable: true},
{header: "联系电话", width: 120, dataIndex: 'telephone', sortable: true},
{header: "电子邮件", width: 100, dataIndex: 'email', sortable: true },
{header: "网站地址", width: 100, dataIndex: 'weburl', sortable: true },
{header: "是否执行同步任务", width: 100, dataIndex: 'isnotsync', sortable: true, renderer:function(value){return getkeyname(value,isnotsync_store.data)}},
{header: "同步任务类型", width: 100, dataIndex: 'synctype', sortable: true, renderer:function(value){return getkeyname(value,synctype_store.data)}},
{header: "是否需要授权", width: 100, dataIndex: 'needauth', sortable: true, renderer:function(value){return getkeyname(value,needauth_store.data)}},
{header: "同步任务地址", width: 100, dataIndex: 'syncurl', sortable: true },
{header: "同步任务结果地址", width: 100, dataIndex: 'resulturl', sortable: true }
],
dockedItems: [{
id:'cp_list_pagingtoolbar',
displayMsg:"显示从{0}条数据到{1}条数据,共{2}条数据",
emptyMsg:"没有数据",
xtype: 'pagingtoolbar',
store: 'vrm.cpManage.CpManageStore', // GridPanel中使用的数据
dock: 'bottom',
displayInfo: true,
plugins:[Ext.create('Ext.ux.PagingToolbarResizer', {displayText:'每页显示条数:',options:VooleUtil.options})]
}]
}]
}]
this.callParent(arguments);
}
});