* Proper fix for ExtJS Delete operation which sometimes sends only an ID

git-svn-id: trunk@17912 -
This commit is contained in:
michael 2011-07-02 13:00:50 +00:00
parent b85355636e
commit 8dfac9c481

View File

@ -15,7 +15,6 @@ type
private
FRows : TJSONArray;
FCurrentRow : TJSONObject;
FIDValue : TJSONData;
FRowIndex : integer;
function CheckData: Boolean;
Public
@ -525,7 +524,10 @@ begin
FCurrentRow:=TJSONObject(D);
end
else if D is TJSONInt64Number then
FIDValue:=D
begin
FRows:=nil;
FCurrentRow:=TJSONObject.Create(['ID',D]);
end
else
begin
FreeAndNil(D);
@ -545,7 +547,6 @@ begin
else
FreeAndNil(FRows);
FRowIndex:=0;
FreeAndNil(FIDValue);
inherited reset;
end;
@ -571,23 +572,14 @@ Var
I : Integer;
begin
Avalue:='';
Result:=False;
if CheckData then
begin
If Assigned(FIDValue) and (0=CompareText(AFieldName,'ID')) then
begin
AValue:=FIDValue.AsString;
Result:=True;
end
else
begin
I:=FCurrentRow.IndexOfName(AFieldName);
Result:=I<>-1;
if result then
if result and (FCurrentRow.Items[I].JSONType<>jtNull) then
AValue:=FCurrentRow.Items[I].AsString;
end;
end;
end;
destructor TExtJSJSonWebdataInputAdaptor.destroy;
@ -595,9 +587,7 @@ begin
If Assigned(FRows) then
FreeAndNil(FRows)
else if assigned(FCurrentRow) then
FreeAndNil(FCurrentRow)
else if Assigned(FIDValue) then
FreeAndNil(FIDValue);
FreeAndNil(FCurrentRow);
inherited destroy;
end;