在 DataGrid 中找不到 Gettinf 属性 **text** 错误

发布于 2024-09-13 09:54:59 字数 404 浏览 2 评论 0原文

我正在为我的 DataGrid 使用自定义 itemEditor。 itemEditor 有一个简单的 TextField 作为组件。 但是当我单击单元格时,我收到错误: ReferenceError:错误#1069:在 editors.customItemEditor 上找不到属性 text,并且没有默认值。 在 mx.controls::DataGrid/itemEditorItemEditEndHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\DataGrid.as:4827]

请帮助我解决此问题。

我的意见是“文本”字段出现错误。但我没有访问“文本”字段或在代码中的任何地方使用它。

问候, 拉维

I am using a custom itemEditor for my DataGrid.
The itemEditor has a simple TextField as a component.
But when ever i am clicking the cell i am getting an error as :
ReferenceError: Error #1069: Property text not found on editors.customItemEditor and there is no default value.
at mx.controls::DataGrid/itemEditorItemEditEndHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\DataGrid.as:4827]

Plz help me to resolve this issue.

My Opinion is that the error is coming for the "text" field. But i havn't accessed "text" field or used it anywhere in my code.

Regards,
Ravi

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

爱她像谁 2024-09-20 09:54:59

我通过将“return data["selected"].toString()”提交到获取文本中解决了问题:

    <mx:DataGridColumn dataField="selected" rendererIsEditor="true" >
            <mx:itemRenderer> 
                <fx:Component>
                    <mx:Box styleName="" width="100%" height="100%" backgroundAlpha="0.0"
                            horizontalAlign="center" verticalAlign="middle">

                        <fx:Script>
                            <![CDATA[

                                public function get text():String
                                {
                                    return data["selected"].toString();
                                }
                                public function set text(value:String):void
                                {

                                }
                                protected function checkbox1_clickHandler(event:MouseEvent):void
                                {
                                    data["selected"]=event.target["selected"];
                                }
                            ]]>
                        </fx:Script>

                        <mx:CheckBox selected="{data.selected}" click="checkbox1_clickHandler(event)"/>
                    </mx:Box>
                </fx:Component>
            </mx:itemRenderer>              
        </mx:DataGridColumn>

i solved the problem with commiting incluting "return data["selected"].toString()" into get text:

    <mx:DataGridColumn dataField="selected" rendererIsEditor="true" >
            <mx:itemRenderer> 
                <fx:Component>
                    <mx:Box styleName="" width="100%" height="100%" backgroundAlpha="0.0"
                            horizontalAlign="center" verticalAlign="middle">

                        <fx:Script>
                            <![CDATA[

                                public function get text():String
                                {
                                    return data["selected"].toString();
                                }
                                public function set text(value:String):void
                                {

                                }
                                protected function checkbox1_clickHandler(event:MouseEvent):void
                                {
                                    data["selected"]=event.target["selected"];
                                }
                            ]]>
                        </fx:Script>

                        <mx:CheckBox selected="{data.selected}" click="checkbox1_clickHandler(event)"/>
                    </mx:Box>
                </fx:Component>
            </mx:itemRenderer>              
        </mx:DataGridColumn>
眼泪也成诗 2024-09-20 09:54:59

取自 http://livedocs.adobe.com/ flex/3/html/help.html?content=celleditor_8.html

默认情况下,Flex 期望项目编辑器向基于列表的控件返回单个值。您可以使用基于列表的控件的 editorDataField 属性来指定包含新数据的项目编辑器的属性。 Flex 将值转换为适合单元格的数据类型。

默认项目编辑器是 TextInput 控件。因此,editorDataField 属性的默认值为“text”,它对应于TextInput 控件的text 属性。如果指定自定义项目编辑器,还可以将 editorDataField 属性设置为项目编辑器的相应属性

Taken from http://livedocs.adobe.com/flex/3/html/help.html?content=celleditor_8.html

By default, Flex expects an item editor to return a single value to the list-based control. You use the editorDataField property of the list-based control to specify the property of the item editor that contains the new data. Flex converts the value to the appropriate data type for the cell.

The default item editor is a TextInput control. Therefore, the default value of the editorDataField property is "text", which corresponds to the text property of the TextInput control. If you specify a custom item editor, you also set the editorDataField property to the appropriate property of the item editor

来世叙缘 2024-09-20 09:54:59

我仍然陷入这个错误,但我认为有希望摆脱它......:)

如果我们将 TextInput 作为 itemEditor,例如:

dataGridColumn.itemEditor = new ClassFactory(TextInput);

那么就没有问题,因为“文本”是在 TextInput 内部定义的。作为。
类似地,如果我复制设置文本并在自定义编辑器中获取文本,那么它工作正常..唯一的问题是
即将到来的是关于提交改变的价值观。

我正在努力,希望我能解决这个问题。

PS:我是这里的新手,所以请原谅我任何愚蠢的 RnD...:p

I am still Struck in this error but i think there is a hope of coming out of it.... :)

If we take TextInput as the itemEditor, like:

dataGridColumn.itemEditor = new ClassFactory(TextInput);

Then there was no problem as "text" is being internally defined inside TextInput.as.
On a similar note if i copy set text and get text inside our custom Editor, then its working fine.. only problem that is
coming is regarding commiting the changed values.

I am working on it, hope i'll be able to sort it out.

P.S.: I am a newbie here, so plz pardon me of any idiotic RnD... :p

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文