NullRefExcep / yii2-datatables

Yii2 Widget for DataTables jQuery plug-in
http://www.datatables.net/
MIT License
72 stars 46 forks source link

How to use related table data #35

Closed yiqiang closed 6 years ago

yiqiang commented 6 years ago

class Order extends ActiveRecord { public function getCustomer() { return $this->hasOne(Customer::className(), ['id' => 'customer_id']); } }

Now i want to make a datatable to show customer name with order id, how can i do that?

ZAYEC77 commented 6 years ago

Hello, please check this issue https://github.com/NullRefExcep/yii2-datatables/issues/13

yiqiang commented 6 years ago

Thank you for support, but then how to do the ordering as mentioned in the last few comments

ZAYEC77 commented 6 years ago

@yiqiang not sure that understand you. What do you mean? If you need set some order you can do it in your query.