#1 2018-09-18 21:49:53

array81
Member
From: Italy
Registered: 2010-07-23
Posts: 411

Edit variant array item

I have a model like this:

  TSQLArticle = class(TSQLContent)
  private
    ...
    fTags: TIntegerDynArray;
    ...
  public
    ...
  published
    ...
    property Tags: TIntegerDynArray index 1 read fTags write fTags;
    ...
  end;

  TSQLTag = class(TSQLRecord)
  private
    fIdent: RawUTF8;
    ...
  published
    property Ident: RawUTF8 index 80 read fIdent write fIdent;
    ...
  end;

Like on your demo 30.
When the user edit an article I need send to mustache templeate the list of all tags (for fill select2 input box) but also send selected tags for article.

If I use this code

tags := RestModel.RetrieveDocVariantArray(TSQLTag ,'','ID, ..., ....');

The JSON contains all tag data of all tags to fill select input box but there is not information about the tag is select or not (TSQLArticle.Tags properties).

Is there a fast way to add this information on all variant array items?

Offline

Board footer

Powered by FluxBB