本文介绍了在列表中拖放项目渲染器(面板)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个spark List,它的项目渲染器是一个面板,面板中有一些组件,比如Textinput,现在我想在列表中拖放一个面板,我该怎么做,你能吗?给我看看代码,谢谢.

I have a spark List,its item renderer is a panel,and in the panel there are some components such as Textinput,now I want to drag and drop a panel within the List,how can I do that,could you pls show me the code,thanks.

推荐答案

感谢您的帮助.现在我在拖动 itemRenderer 时遇到错误(我的 flex sdk 是 4.5.1).我的列表项渲染器:

thanks for your help.Now I catch an error while draging the itemRenderer(my flex sdk is 4.5.1).My list itemRenderer:

<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/mx"
            width="100%" height="100%">
    <fx:Script>
    <![CDATA[
        import mx.events.CloseEvent;


        override public function set data(value:Object ) : void{
            super.data = value;
        }

        protected function closeHandler(event:CloseEvent):void
        {
            //ToDo
        }

    ]]>
</fx:Script>
    <s:TitleWindow x="0" y="0" title="{data.label}"
               width="100%" height="100%" creationPolicy="all"
               skinClass="skin.titleWindowSkin"
               close="closeHandler(event)">
    <s:Label text="{data.value}"/>

    <s:TextInput x="123" y="58" text="@{data.value}"
                 focusIn="parentDocument.owner.dragEnabled=false"
                 focusOut="parentDocument.owner.dragEnabled=true"/>

</s:TitleWindow>
</s:ItemRenderer>

在拖动时,遇到如下错误:错误:无法找到 DragProxy261.ListItemDragProxy260.DspDesktopItemRenderer262._DspDesktopItemRenderer_TitleWindow1.titleWindowSkin264.Group265.contents._titleWindowSkin_Group5.contentGroup._DspDesktopItemRenderer_TextInput1 的外观.在 spark.components.supportClasses::SkinnableComponent/attachSkin()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:698]

While draging,catch an error like:Error: Skin for DragProxy261.ListItemDragProxy260.DspDesktopItemRenderer262._DspDesktopItemRenderer_TitleWindow1.titleWindowSkin264.Group265.contents._titleWindowSkin_Group5.contentGroup._DspDesktopItemRenderer_TextInput1 cannot be found. at spark.components.supportClasses::SkinnableComponent/attachSkin()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:698]

这篇关于在列表中拖放项目渲染器(面板)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 23:02