So I've got a nice list of products in a tableselect element, like this:
$form['nodes'] = array( '#type' => 'tableselect', '#header' => $header, '#options' => $options, '#empty' => t('No content available.'), );
I'm using EntityFieldQuery to make $options and each row is a "product", with a "product type" field which is a taxonomy term. But I want to sort the "product type" column by the taxonomy term rather than the tid (currently they aren't alphabetical and I intend to add more). This is what I've got now:
$header = array( 'Name' => array(... ), 'Product_type' => array( 'data' => t('Product Type'), 'type'=>'field', 'specifier' => array( 'field'=>'field_product_type', 'column'=>'tid', ),), 'Price' => array(...), ... );
Is there a way to do this? I'm trying to avoid using "Views".