DataProvider로 ArrayCollection을 가진 Datagrid가 있고, remoteObject 호출로 arrayCollection이 부분적으로 생성되었지만 dataprovider가 필드를 편집 할 때까지 작동하는 것 같습니다.DataProvider로 ArrayCollection을 사용하는 DataGrid의 이상한 동작
RemoteObject가함으로써난 단지 필드 ip
와 함께있는 ArrayCollection을받을 수 있지만, 데이터 그리드는 필드를 찾습니다 ip
, check
및 save
... 난 단지 특정 조건
DataGrid :
<s:DataGrid id="datagrid" left="10" right="10" top="136"
dataProvider="{listaIPCheck}" bottom="10" requestedRowCount="4">
<s:columns>
<s:ArrayList>
<s:GridColumn dataField="ip" headerText="Asset"/>
<s:GridColumn dataField="check" headerText="Inventory"/>
<s:GridColumn dataField="save" headerText="Salvataggio"/>
</s:ArrayList>
</s:columns>
</s:DataGrid>
스크립트 : 여기
[Bindable]private var listaIPCheck:ArrayCollection;
private function ro_resultHandler(event:Event=null):void
{
listaIPCheck = new ArrayCollection();
listaIPCheck = ro.getListUpdate.lastResult;
heap = 0;
// Read Below {POINT #1}
init3();
}
private function init3():void
{
// Read Below {POINT #2}
if (heap<listaIPCheck.length)
{
// omitted the initialization of the process p
p.addEventListener(NativeProcessExitEvent.EXIT, onExit);
try{
p.start(startupInfo);
}catch(e:Error){}
}
}
private function onExit(e:NativeProcessExitEvent):void {
// Read below {POINT #3}
}
가 지금은 아래를 참조 쓴 3 라인이 있습니다 당신이 볼 수있는, 내 코드입니다 ... 는의가 대신 간단한
for
를 넣어 가정 해 봅시다
for (var k:Number=0;k<listaIPCheck.length;k++)
{
listaIPCheck.getItemAt(k).check = "checkVal";
listaIPCheck.getItemAt(k).save = "saveVal";
}
ONL 항목을 새로 고치의 ArrayCollection 항상 새로운 가치로 가득 호출의 끝,하지만 데이터 그리드에서, 그래서이 코드는 항상 3 점에서 작동 (한 번 한 번에) 주석 라인 y의 점 #1
및 #2
왜 안되는가? Point #3
???
왜 p의 initilization 프로세스를 생략 했습니까? 이게 뭐야? DataGrid는 편집 할 수 없기 때문에 필드를 어떻게 편집하고 있습니까? 편집중인 분야는 무엇입니까? 코드가 작동하지 않는다고 말할 때; 이슈가 뭐야? 어떻게 작동하지 않습니까? 런타임 오류가 발생합니까? 아니면 예기치 않은 행동을 보입니까? – JeffryHouser
P에 대한 초기화 프로세스를 생략 했으므로 문제와 관련이 없습니다 ... POINT 1-2-3에서 'for'을 번갈아 사용하고 지정된 값을 올바르게 업데이트/추가하십시오. 문제는 POINT 3에서는 ArrayCollection이 편집되었지만 DataGrid에서 변경 내용이 새로 고쳐지지 않는 반면에 1-2 점은 (arrayCollection) 업데이트되고 (DataCrid에 의해) 새로 고쳐 짐 – Marcx