Closed ErvinLlojku closed 9 years ago
@ErvinLlojku, add the table alias as part of the data attribute name in the DataTables columns array.
data: "e.title" as an example. Just make sure that is corresponds with a table alias you have specified in the fromTableStr or the joinArray
Hello,
I have a problem with the data i get when joining tables. For example i have section table with this attributes id,name,title,created_at And the table Entries id,name,title,section_id
In the table i want to show id | sectionName | EntrieName
but in the entrieName Column i get the name of the section
This happens for other attributes that have the same name in the db like (title).
public function appendToSelectStr() { return null; } public function fromTableStr() { return 'subcategories s'; } public function joinArray(){ return array( 'categories c' => 's.category_id = c.id', 'sections sec' => 's.section_id = sec.id', ); } public function whereClauseArray(){ return null; }
I am using CI3.
Thanks.