function triggerDrag(){ |
var node= null ; |
|
Ext.each(Ext.getCmp( 'left_panel' ), function (accrd){ |
Ext.each(accrd.items.items, function (tree){ |
tree.getRootNode().cascade( function (node) { |
if (!node.isLeaf() && !node.isLoaded()) { |
node.collapse( false , false ); |
while (node.firstChild){ |
node.removeChild(node.firstChild).destroy() |
} |
node.childrenRendered= false ; |
node.loaded= false ; |
if (node.isHiddenRoot()){ |
node.expanded= false ; |
} |
node.expand( false , false , function (){ |
node.collapse(); |
}, null ); |
return true ; |
} |
if (node.attributes[ 'url' ] && node.attributes[ 'url' ].indexOf( 'HealthReport' ) > 0) { |
|
//委派拖拽 |
var proxy= new Ext.dd.DragSource(node.getUI().getEl(),{group: 'dd' }); |
var target= new Ext.dd.DDTarget( 'dargDiv' , 'dd' ); |
|
//完成拖拽后触发的事件 |
proxy.afterDragDrop = function (target, e, idc) { |
|
if (Ext.get( "srt" + node.attributes.id)){ |
Ext.Msg.alert( '提示' , '此快捷方式您已经添加!' ); |
return ; |
} |
|
//构造快捷方式持久化对象 |
var obj = { |
shortcutname : node.attributes.text, |
shortcuttype : '0' , |
shortcutcode : node.attributes.code, |
shortcutid : Number(node.attributes.id), |
shortcuturl : node.attributes.url, |
userid : top._APP.operator.id |
}; |
|
//持久快捷方式对象 |
_Ajax.request({ |
url : 'system/Common_saveObj.action' , |
params:{ |
clazz: 'com.tbyf.health.entity.XtShortcut' |
}, |
xmlData: obj, |
result : function (obj) { |
initShortcuts(); |
} |
}); |
}; |
} |
return true ; |
}); |
}); |
}); |
} |