This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

daniel22101
daniel22101

Each product in my database has a list of images.

The images are sorted by a column called sort_order. The idea is to have buttons in the relation list that will allow users to change the order of the image.

<button
        type="button"
        data-request="onSortUp"
        data-request-update="????"
        data-request-data="id: '<?= $record->id ?>'"
        class="btn btn-primary icon-arrow-up"></button>

The question is how can I refresh the relation list?

config_relation.yaml

images:
  label: Images

  view:
    defaultSort:
      column: sort_order
      direction: asc

    list:
      columns:
        id:
          label: ID
          searchable: true
          sortable: false
          width: 64px
        title:
          label: Title
          searchable: true
          sortable: false
        sort_order:
          label: Order
          type: partial
          path: sort-action
          searchable: false
          sortable: false
          width: 106px
    toolbarButtons: add|remove

1-1 of 1

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.