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

vince_o
vince_o

On my Product model, I have a few attributes in my $appends array. I have defined accessors for these attributes in the Product model as well. In my columns.yaml for the Product model, I have:

# ===================================
#  List Column Definitions
# ===================================

columns:
    name:
      label: Name

    num_skus:
      label: "# SKUs"
      sortable: false
      searchable: false

    qty_in_stock:
      label: Qty. In Stock
      sortable: false
      searchable: false

    num_sold:
      label: "# Sold"
      sortable: false
      searchable: false

    published:
      label: Published
      type: switch

This works fine, and displays the appended columns (num_skus, qty_in_stock, and num_sold). But if I remove sortable: false, I get an SQL error:

SQL Error

It seems that October does its list sorting server-side using an SQL select statement with an order_by clause, so naturally this fails because there is no num_skus column. IMO a client-side (ala datatables) sort would be better. But has anyone else encountered this and come up with a work around?

Thanks.

Last updated

axomat
axomat

Yes I have had this problem but I could not find a solution so I had to disable those columns which is a little annoying!

arrcrown
arrcrown

any update on this?

1-3 of 3

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