extjs4.2 desktop窗体遮罩层问题 extjs4desktop 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Ext.create("Ext.grid.Panel", { xtype: "grid", title: "根目录", columnWidth: 1, store: store, height: "500", region: "center", id: "selectgrid", emptyText: '该目录为空!请点击<img src="../images/desktopUI/folder-back.png">上一级!', selModel: selModel, disableSelection: false, columns: [ {text: "", width: 30,dataIndex: "leaf"}, {text: "文件名", width: 150,flex: 1,dataIndex: "name",sortable: true}, {text: "类型", width: 80,dataIndex: "extname",sortable: false}, {text: "大小", width: 100,dataIndex: "filesize",align: "right",sortable: true}, {text: "创建时间",width: 150,dataIndex: "createtime",renderer: function(A) {return A.replace("T", " ")},sortable: true} ], listeners: { itemdblclick: function(D, A, C, E, B) { if (A.raw.filesize == "") { store.load({ params: {subId: A.raw.filedir}, callback: function(records,options,success){ if(success==true){//加载成功 var I = store.getCount(); if(I>0){ fdir= store.getAt(0).get('filedir') }else{ fdir = A.raw.filedir + "@thisnewfolder"; } } }, scope: store, add: false }) } }, itemcontextmenu: function(G, B, E, F, C, D) { C.preventDefault(); C.stopEvent(); var A = new Ext.menu.Menu({ items: [{ text: "新建目录", iconCls: "folder_new", handler: function() { this.up("menu").hide(); fpnewdir() } }, { text: "打开", iconCls: "folder_open", handler: function() { this.up("menu").hide(); if (B.raw.filesize == "") { store.load({ params: {subId: B.raw.filedir} }) } else { var H = Ext.create("widget.uxNotification", { title: "信息窗口", corner: "br", stickOnClick: false, manager: "desktop", iconCls: "ux-notification-icon-information", html: "" }); H.show() } } }, { text: "下载", iconCls: "folder_download", handler: function() { this.up("menu").hide(); fpdownload() } }, { text: "重命名", iconCls: "folder_rename", handler: function() { this.up("menu").hide(); Ext.MessageBox.prompt("重命名", "请输入", function(H, I) { if (H == "ok") { if (I.length < 1) { Ext.example.msg('重命名:', '文件(夹)名称不能为空!'); return } if (I != stripscript(I)) { Ext.example.msg('重命名:', '文件(夹)名称含非法字符!'); return } Ext.Ajax.request({ url: "../data/FactoryPhotoDo-JSON.php?cmd=ren&dirname=" + B.raw.name + "&newname=" + encodeURIComponent(I), success: function(J) { var K = Ext.JSON.decode(J.responseText); if (K.success == true) { store.load({ params: {cmd: "cmdrefresh"} }); Ext.example.msg('重命名:', '重命名已成功提交,请点<img src="../images/desktopUI/shuaxin.png">刷新查看结果!') } else { Ext.example.msg('重命名:', '重命名提交失败,请检查是否权限不够!') } }, failure: function(J) { Ext.example.msg('重命名错误:', '请与管理员联系!') } }) } }, this, false, B.raw.name) } }, { text: "剪切", iconCls: "folder_cut", handler: function() { this.up("menu").hide(); fpcopy(1) } }, { text: "复制", iconCls: "folder_copy", handler: function() { this.up("menu").hide(); fpcopy(0) } }, { text: "删除", iconCls: "folder_del", handler: function() { this.up("menu").hide(); fpdel() } }] }).showAt(C.getXY()) } }, dockedItems: [{ dock: "top", xtype: "toolbar", items: [{ itemId: "cmdup", text: "上一级", iconCls: "folder-back", handler: function() { store.load({ params: {cmd: "cmdup",path: fdir}, callback: function(records,options,success){ if(success==true){//加载成功 var I = store.getCount(); if(I>0){ fdir= store.getAt(0).get('filedir') }else{ fdir = A.raw.id + "@thisnewfolder"; } } }, scope: store, add: false }) } }, { itemId: "cmdroot", text: "根目录", iconCls: "xtxx", handler: function() { fdir="root"; store.load({ params: {cmd: "cmdroot",path: 'root'} }) } }, { itemId: "cmdrefresh", text: "刷新", iconCls: "refresh", handler: function() { store.load({ params: {cmd: "cmdrefresh",path: fdir} }) } }, { itemId: "cmddelete", text: "删除", iconCls: "folder_del", handler: fpdel }, { itemId: "cmdnewdir", text: "新建目录", iconCls: "folder_new", handler: fpnewdir }, { itemId: "webdiskcut", text: "剪切", iconCls: "folder_cut", handler: function() {fpcopy(1)} }, { itemId: "webdiskcopy1", text: "复制", iconCls: "folder_copy", handler: function() {fpcopy(0)} }, { itemId: "cmdpaste", text: "粘贴", iconCls: "folder_paste", handler: function() { Ext.Ajax.request({ url: "../data/FactoryPhotoDo-JSON.php?cmd=paste&dirname=files", success: function(A) { var B = Ext.JSON.decode(A.responseText); if (B.success == true) { if (B.msg == "成功") { Ext.example.msg('粘贴:', '已粘贴到当前目录!'); store.load({ params: {cmd: "cmdrefresh"} }) } else{ Ext.example.msg('粘贴:', B.msg) } } else { Ext.example.msg('粘贴:', '粘贴提交失败,请检查是否权限不够!') } }, failure: function(A) { Ext.example.msg('粘贴数据错误:', '请与管理员联系!') } }) } }, { itemId: "webdiskupload", text: "上传", iconCls: "folder_upload", handler: function() { var A = new Ext.Window({ title: "新图片上传", width: 700, height: 530, closeAction: "hide", modal: true, listeners: { beforehide: function() { store.load({ params: {cmd: "cmdrefresh"} }) } }, html: '' }); if (A.hidden == true) { A.show() } else { A.hide() } } }, { itemId: "webdiskdownload", text: "下载", iconCls: "folder_download", handler: fpdownload }] }]});附上GRID。PANEL构建代码,DESKTOP核心代码是改写EXTJS官方样例。 在dreamweaver 2004中,会员登录功能彻底的实现 怎么设置函数运行的时间,比如设置这个函数只能运行10秒,超过10秒就退出 合并函数 求教!! Extjs LockingGridPanel 列表编辑问题 xmlHTTPrequest responseText iframe菜鸟问题 求助:还是ONBLUR的问题 Dreamweaver的请进! 请问如何计算四舍五入 怎么样动态生成表格中的行列,并可以实现跨多行或是多列? jquery做一个下拉菜单遇到的问题 jq如何动态获取标签id方法?
xtype: "grid",
title: "根目录",
columnWidth: 1,
store: store,
height: "500",
region: "center",
id: "selectgrid",
emptyText: '该目录为空!请点击<img src="../images/desktopUI/folder-back.png">上一级!',
selModel: selModel,
disableSelection: false,
columns: [
{text: "", width: 30,dataIndex: "leaf"},
{text: "文件名", width: 150,flex: 1,dataIndex: "name",sortable: true},
{text: "类型", width: 80,dataIndex: "extname",sortable: false},
{text: "大小", width: 100,dataIndex: "filesize",align: "right",sortable: true},
{text: "创建时间",width: 150,dataIndex: "createtime",renderer: function(A) {return A.replace("T", " ")},sortable: true}
],
listeners: {
itemdblclick: function(D, A, C, E, B) {
if (A.raw.filesize == "") {
store.load({
params: {subId: A.raw.filedir},
callback: function(records,options,success){
if(success==true){//加载成功
var I = store.getCount();
if(I>0){
fdir= store.getAt(0).get('filedir')
}else{
fdir = A.raw.filedir + "@thisnewfolder";
}
}
},
scope: store,
add: false
})
}
},
itemcontextmenu: function(G, B, E, F, C, D) {
C.preventDefault();
C.stopEvent();
var A = new Ext.menu.Menu({
items: [{
text: "新建目录",
iconCls: "folder_new",
handler: function() {
this.up("menu").hide();
fpnewdir()
}
},
{
text: "打开",
iconCls: "folder_open",
handler: function() {
this.up("menu").hide();
if (B.raw.filesize == "") {
store.load({
params: {subId: B.raw.filedir}
})
} else {
var H = Ext.create("widget.uxNotification", {
title: "信息窗口",
corner: "br",
stickOnClick: false,
manager: "desktop",
iconCls: "ux-notification-icon-information",
html: ""
});
H.show()
}
}
},
{
text: "下载",
iconCls: "folder_download",
handler: function() {
this.up("menu").hide();
fpdownload()
}
},
{
text: "重命名",
iconCls: "folder_rename",
handler: function() {
this.up("menu").hide();
Ext.MessageBox.prompt("重命名", "请输入",
function(H, I) {
if (H == "ok") {
if (I.length < 1) {
Ext.example.msg('重命名:', '文件(夹)名称不能为空!');
return
}
if (I != stripscript(I)) {
Ext.example.msg('重命名:', '文件(夹)名称含非法字符!');
return
}
Ext.Ajax.request({
url: "../data/FactoryPhotoDo-JSON.php?cmd=ren&dirname=" + B.raw.name + "&newname=" + encodeURIComponent(I),
success: function(J) {
var K = Ext.JSON.decode(J.responseText);
if (K.success == true) {
store.load({
params: {cmd: "cmdrefresh"}
});
Ext.example.msg('重命名:', '重命名已成功提交,请点<img src="../images/desktopUI/shuaxin.png">刷新查看结果!')
} else {
Ext.example.msg('重命名:', '重命名提交失败,请检查是否权限不够!')
}
},
failure: function(J) {
Ext.example.msg('重命名错误:', '请与管理员联系!')
}
})
}
},
this, false, B.raw.name)
}
},
{
text: "剪切",
iconCls: "folder_cut",
handler: function() {
this.up("menu").hide();
fpcopy(1)
}
},
{
text: "复制",
iconCls: "folder_copy",
handler: function() {
this.up("menu").hide();
fpcopy(0)
}
},
{
text: "删除",
iconCls: "folder_del",
handler: function() {
this.up("menu").hide();
fpdel()
}
}]
}).showAt(C.getXY())
}
},
dockedItems: [{
dock: "top",
xtype: "toolbar",
items: [{
itemId: "cmdup",
text: "上一级",
iconCls: "folder-back",
handler: function() {
store.load({
params: {cmd: "cmdup",path: fdir},
callback: function(records,options,success){
if(success==true){//加载成功
var I = store.getCount();
if(I>0){
fdir= store.getAt(0).get('filedir')
}else{
fdir = A.raw.id + "@thisnewfolder";
}
}
},
scope: store,
add: false
})
}
},
{
itemId: "cmdroot",
text: "根目录",
iconCls: "xtxx",
handler: function() {
fdir="root";
store.load({
params: {cmd: "cmdroot",path: 'root'}
})
}
},
{
itemId: "cmdrefresh",
text: "刷新",
iconCls: "refresh",
handler: function() {
store.load({
params: {cmd: "cmdrefresh",path: fdir}
})
}
},
{
itemId: "cmddelete",
text: "删除",
iconCls: "folder_del",
handler: fpdel
},
{
itemId: "cmdnewdir",
text: "新建目录",
iconCls: "folder_new",
handler: fpnewdir
},
{
itemId: "webdiskcut",
text: "剪切",
iconCls: "folder_cut",
handler: function() {fpcopy(1)}
},
{
itemId: "webdiskcopy1",
text: "复制",
iconCls: "folder_copy",
handler: function() {fpcopy(0)}
},
{
itemId: "cmdpaste",
text: "粘贴",
iconCls: "folder_paste",
handler: function() {
Ext.Ajax.request({
url: "../data/FactoryPhotoDo-JSON.php?cmd=paste&dirname=files",
success: function(A) {
var B = Ext.JSON.decode(A.responseText);
if (B.success == true) {
if (B.msg == "成功") {
Ext.example.msg('粘贴:', '已粘贴到当前目录!');
store.load({
params: {cmd: "cmdrefresh"}
})
} else{
Ext.example.msg('粘贴:', B.msg)
}
} else {
Ext.example.msg('粘贴:', '粘贴提交失败,请检查是否权限不够!')
}
},
failure: function(A) {
Ext.example.msg('粘贴数据错误:', '请与管理员联系!')
}
})
}
},
{
itemId: "webdiskupload",
text: "上传",
iconCls: "folder_upload",
handler: function() {
var A = new Ext.Window({
title: "新图片上传",
width: 700,
height: 530,
closeAction: "hide",
modal: true,
listeners: {
beforehide: function() {
store.load({
params: {cmd: "cmdrefresh"}
})
}
},
html: ''
});
if (A.hidden == true) {
A.show()
} else {
A.hide()
}
}
},
{
itemId: "webdiskdownload",
text: "下载",
iconCls: "folder_download",
handler: fpdownload
}]
}]
});附上GRID。PANEL构建代码,DESKTOP核心代码是改写EXTJS官方样例。