Does TXDataWebDataset have the equivalent to TWebDBClientDataset.Rows?

I want to copy data from a TXDataWebDataset to another dataset ( I was thinking of a TWebDBClientDataset). In a normal Delphi app I would just clone TClientDataset so I had a sceond cursor on the data rather than just a copy, but a copy will do in this insatnce.

What would be the best approach for this?

TXDataWebDataset has the property CurrentData which is the underlying JSValue for the current row. You can iterate through the whole dataset to build a TJSArray with it:

var
  Rows: TJSArray;
begin
  Rows := TJSArray.new;
  XDataWebDataset1.First;
  while not XDataWebDataSet1.Eof do
  begin
    Rows.push(XDataWebDataset1.CurrentData);
    XDataWebDataSet1.Next;
  end;
  WebClientDataSet1.Rows := Rows;
end;

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.