×
Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
Show on list view no longer working correctly
alex
New Member
Posts: 2
7 年 10 个月 前 #1470
由 alex
Show on list view no longer working correctly was created by alex
I have a field J_SQL
It is a select of virtuemart products.
On the list view it always has shown the "selected" product. ie the value in the database.
Now, after my last rebuild the list view shows all the same product , which is the "lowest id" in the virtuemart product database.
It is a select of virtuemart products.
On the list view it always has shown the "selected" product. ie the value in the database.
Now, after my last rebuild the list view shows all the same product , which is the "lowest id" in the virtuemart product database.
Please 登录 或 注册一个帐号 to join the conversation.
Andres Maeso
Platinum Member
Posts: 338
7 年 10 个月 前 - 7 年 10 个月 前 #1471
由 Andres Maeso
Andrés Maeso
Customer relations manager at Joomla Component Creator.
该邮件地址已受到反垃圾邮件插件保护。要显示它需要在浏览器中启用 JavaScript。
Replied by Andres Maeso on topic Show on list view no longer working correctly
Hi Alex,
Just wanted to remind you that this is a community forum where users give advice to each other. As a premium user you can send a support ticket www.component-creator.com/en/help/contact and our developers will give you some tips.
Regards,
Andrés.
Just wanted to remind you that this is a community forum where users give advice to each other. As a premium user you can send a support ticket www.component-creator.com/en/help/contact and our developers will give you some tips.
Regards,
Andrés.
Andrés Maeso
Customer relations manager at Joomla Component Creator.
该邮件地址已受到反垃圾邮件插件保护。要显示它需要在浏览器中启用 JavaScript。
Last edit: 7 年 10 个月 前 by Andres Maeso.
Please 登录 或 注册一个帐号 to join the conversation.
Chris
New Member
Posts: 3
7 年 9 个月 前 #1484
由 Chris
Replied by Chris on topic Show on list view no longer working correctly
I see same problem. I checked my database, data is saving correctly, but showing incorrectly on admin list view.
Please 登录 或 注册一个帐号 to join the conversation.
Chris
New Member
Posts: 3
7 年 9 个月 前 #1485
由 Chris
Replied by Chris on topic Show on list view no longer working correctly
I was able to adjust the query in the list model, adding a left join, grabbing the correct data. Then I edited the view file, showing the "name" rather than the "id" of the field in question. This challenged my SQL skills, but solved the problem.
Please 登录 或 注册一个帐号 to join the conversation.
alex
New Member
Posts: 2
7 年 9 个月 前 #1487
由 alex
Replied by alex on topic Show on list view no longer working correctly
so how did you solve this?
can you post it here?
can you post it here?
Please 登录 或 注册一个帐号 to join the conversation.
Chris
New Member
Posts: 3
7 年 9 个月 前 #1490
由 Chris
Replied by Chris on topic Show on list view no longer working correctly
Alex, Something like this...
let's say you have "items" and "parents". You want to show a list of items with the correct parent name.
Modify the query in the model, adding #__parents.name AS parentName in the select().
Modify the query further, adding a LEFT JOIN ON item.parent_id = #__parents.id.
Notice the parentName alias, this is important. I think I also aliased the table name simply to reduce typing, not important.
Now go into your view. Instead of displaying parent_id, display parentName. You probably don't have a "parentName" column in your #__parents table, that's ok, we created one on the fly with our alias.
I had to brush up on MySql joins as well as the JDatabase query() object.
As always for testing, in the model, before "return $query", add var_dump( $query->__toString() ); die; so that you can monitor the query. Cut and paste into PHPMyAdmin to test.
As an alternative, blow away the query found in the model, and write your own, might be simpler. Just remember to join "name" from the "parents" table as an alias.
That's as specific as I can explain, hope it helps.
let's say you have "items" and "parents". You want to show a list of items with the correct parent name.
Modify the query in the model, adding #__parents.name AS parentName in the select().
Modify the query further, adding a LEFT JOIN ON item.parent_id = #__parents.id.
Notice the parentName alias, this is important. I think I also aliased the table name simply to reduce typing, not important.
Now go into your view. Instead of displaying parent_id, display parentName. You probably don't have a "parentName" column in your #__parents table, that's ok, we created one on the fly with our alias.
I had to brush up on MySql joins as well as the JDatabase query() object.
As always for testing, in the model, before "return $query", add var_dump( $query->__toString() ); die; so that you can monitor the query. Cut and paste into PHPMyAdmin to test.
As an alternative, blow away the query found in the model, and write your own, might be simpler. Just remember to join "name" from the "parents" table as an alias.
That's as specific as I can explain, hope it helps.
The following user(s) said Thank You: Andres Maeso
Please 登录 或 注册一个帐号 to join the conversation.
创建页面时间:0.063秒