How to access Field Options on frontend?

How to access Field Options on frontend?

YOMYOM Posts: 53Questions: 22Answers: 1
edited March 11 in Priority support

Hi, I'm defining the following field options in my NodeJS server within an Mjoin.

    .join(
      new Mjoin("media_types")
        .link("skus.yom_sku", "product_media_types.product_id")
        .link("media_types.id", "product_media_types.media_type_id")
        .order("name asc")
        .fields(
          new Field("id").options(
            new Options().table("media_types").value("id").label("name")
          ),

          new Field("name")
        )
    )

How can I access these options on the frontend to manually populate my own select element?

I'm aware datatables will do this automatically but I'm requiring a custom solution (using a view for displaying the column value) as mjoins don't support column searching.

Please let me know!

This question has an accepted answers - jump to answer

Answers

  • YOMYOM Posts: 53Questions: 22Answers: 1
    Answer ✓

    Ah, this did the trick for me. Found it in another forum post.

      editor.field("media_types[].id").input().children()
    
  • allanallan Posts: 63,482Questions: 1Answers: 10,467 Site admin

    Thanks for posting back - good to hear you found a solution.

    Allan

Sign In or Register to comment.