2010-08-09 1 views
0

Я использую собственный элемент itemEditor для моего DataGrid. Элемент ItemEditor имеет простой TextField как компонент. Но когда я когда-либо нажимаю на ячейку, я получаю сообщение об ошибке: ReferenceError: Ошибка # 1069: Свойство текст не найден на editors.customItemEditor и нет значения по умолчанию. в mx.controls :: DataGrid/itemEditorItemEditEndHandler() [C: \ автосборки \ 3.2.0 \ рамки \ проекты \ рамки \ SRC \ тх \ управления \ DataGrid.as: 4827]Gettinf Property ** текст ** не найдена ошибка в DataGrid

Plz помочь мне решить эту проблему вопрос.

Мое мнение, что ошибка подходит для поля «текст». Но я не получил доступ к «текстовому» полю или использовал его в любом месте моего кода.

С уважением, Ravi

ответ

0

Взятые из 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
0

Я до сих пор Пораженный в этой ошибки, но я думаю, что есть надежда на выходе из него .... :)

Если мы возьмем TextInput как itemEditor, например:

dataGridColumn.itemEditor = new ClassFactory(TextInput); 

Тогда не было никаких проблем, так как внутри TextInput.as внутренне определено «текст». На аналогичной заметке, если я скопирую текст и получаю текст внутри нашего настраиваемого редактора, тогда его работающий штраф .. только проблема, которая составляет , заключается в совершении измененных значений.

Я работаю над этим, надеюсь, что смогу разобраться.

PS: Я новичок здесь, так что простите плз мне любой идиотский RnD ...: р

1

я решил проблему с incluting совершали «возвращают данные [» выбранные «] в 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> 
Смежные вопросы