ÔÚExcelÓëFlexÖ®¼äÕ³ÌùÊý¾Ý
2ÖÖ·½·¨£¬
Ò»£¬ÀûÓÃjs¶ÁÈ¡ð¤Ìù°æ£º
var content = clipboardData.getData("Text");
document.getElementById("${application}").getClipboardData(content);
¶þ£¬Ö±½Ó¸´ÖƵ½datagrid
ÔÚDataGridÖУ¬µ±°´ÏÂCtrl¼üʱ£¬ÎÒÃÇ´´½¨Ò»¸öÒþ²ØµÄÎı¾£¨TextField£©×é¼þ£¬²¢½«½¹µã¶¨Î»¸øËü£¬ÕâÑù£¬ÎÒÃǾͿÉÒÔ½ÓÊÜÈκÎͨ¹ýCtrl+VÕ³Ìù¹ýÀ´µÄÊý¾Ý¡£ÏàÓ¦µÄÎÒÃÇÒ²½«DataGridÑ¡ÔñÐÐÊý¾ÝÒÔTSV¸ñʽ¿½±´µ½TextField×é¼þÖУ¬²¢ÇÒ½«ËùÓеÄÎı¾Ñ¡Ôñ£¬ÕâÑùÎÒÃÇʹÓÃCtrl+C²Ù×÷¾Í¿ÉÒÔ¸´ÖƵ±Ç°ÐÐËùÓÐÊý¾ÝÁË¡£
¼àÌýÒþ²ØÎļþ×é¼þµÄtextInputʼþ¡£Èç¹ûÓÐÈκÎÊý¾Ý±»Õ³ÌùµÄ»°£¬ÄÇôÔÚÕâÀïÊý¾Ý½«±»½âÎö£¬²¢²åÈëµ½DataGridÖС£
µ±Ctrl¼üÊͷźó£¬ÒƳýÒþ²ØµÄÎı¾×é¼þ
¿´Àý×Ó´úÂ룺
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<!--[CDATA[
import flash.events.KeyboardEvent;
private function dataGridKeyDownHandler(event:KeyboardEvent):void
{
if (event.ctrlKey && !dataGrid.getChildByName("clipboardProxy"))
{
// Add an invisible TextField object to the DataGrid
var textField:TextField = new TextField();
textField.name = "clipboardProxy";
dataGrid.addChild(textField);
textField.visible = false;
textField.type = TextFieldType.INPUT;
textField.multiline = true;
// Populate the TextField with selected data in TSV format
textField.text = getTextfromItems(dataGrid.selectedItems);
textField.setSelection(0, textField.text.length - 1);
// Listen for textInput event
textField.addEventListener(TextEvent.TEXT_INPUT,
clipboardProxyPasteHandler);
// Set player-level focus to the TextField
systemManager.stage.focus = textField;
}
}
private function dataGridKeyUpHandler(event:KeyboardEvent):void
{
if (!event.ctrlKey)
{
var textField:TextField = TextField(dataGrid
.getChildByName("clipboardProxy"));
if (textField)
dataGrid.r
Ïà¹ØÎĵµ£º
Ç°¼¸ÌìÒ»Ö±±»ÎªÊ²Ã´ÎÒµÄpdfÎļþÎÞ·¨ÔÚair³ÌÐòÖÐÏÔʾ³öÀ´·³×Å.
ÔÚ¼¸¸ö²»Í¬µÄÂÛ̳·¢ÁËÌû×Ó,¿ÉÊǻشðµÄÈËÁÈÁÈÎÞ¼¸, ÎÒ¶¼»³ÒÉÊDz»ÊÇÎÒµÄÎÊÌâÌ«¼òµ¥ÁË,´ó¼Ò¶¼Ã»ÓÐÈ¥»Ø´ðµÄÓûÍû, ±Ï¾¹ÎҲŽӴ¥flex.
½ñÌìÔçÉÏÖÕÓÚÏë³öÁË´ð°¸:
ÔÀ´±ØÐëÔÚÕýÈ·°²×°ÁËair³ÌÐòÖ®ºó²ÅÄܼÓÔØpdfÎļþ.
ÎҵijÌÐòûÓдí,´íÔÚÎÒÊÇÔÚFlex builderÏÂÔËÐÐµÄ ......
XML ×÷ΪÊý¾ÝÔ´µÄʵÀý£¨TESTED£©
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" preinitialize="preInit()" fontSize="12" height="500">
<mx:Script>
  ......
ÒÔϽéÉܼ¸ÖÖ×îΪ³£¼ûºÍʵÓõÄFLEXÓëÏÖÓпª·¢ÓïÑÔͨÐŵķ½·¨£º
1.C#
2.PHP
3.JAVA
1.FlexÓëC#ͨÐÅ(.net¿ª·¢Öг£ÓÃ)
Flex¶Ë´úÂë:
public static function SendMessage(objXML:XML,objResultHandle:Function):void
{
var objHttpService:HTT ......
Ê×ÏÈÔÚfademo.mxmlÖÐÉùÃ÷Ò»¸öbutton£¬²¢Ìí¼ÓÒ»¸öbtnClick·½·¨£º
view plaincopy to clipboardprint?
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
......
1. ×î¼òµ¥µÄ¾¯¸æ´°¿Ú
ÄãÐèÒªÏȵ¼ÈëAlertÀࣺ import mx.controls.Alert;
È»ºóÔÚÏëÒªµ¯³ö¾¯¸æµÄʱºòʹÓãº
Alert.show(“ÄãÈ·¶¨ÒªÍ˳öϵͳÂð?”,“È·ÈÏ”,Alert.YES|Alert.NO,null,logout)
²ÎÊý˵Ã÷£ºµÚÒ»¸ö²ÎÊýÊÇÒªÏÔʾµÄÎı¾£¬µÚ¶þ¸ö²ÎÊýÊÇ´°¿ÚµÄ±êÌ⣬ÕâÁ½¸ö²ÎÊýÊÇ×î¾³£Óõġ£µÚÈý¸ö²ÎÊýÊÇ°´Å¥£ ......