Q: How to display a select box (type: list) in a Joomla XML file to meet Joomla 5 standards?

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: Q: How to display a select box (type: list) in a Joomla XML file to meet Joomla 5 standards?

Re: Q: How to display a select box (type: list) in a Joomla XML file to meet Joomla 5 standards?

โดย Raja Pdl » 27/12/2024 9:39 pm

tsukasaz เขียน: 27/12/2024 11:34 am The problem is caused by the JS of Chosen. You need to remove this line.

โค้ด: เลือกทั้งหมด

JHtml::_('formbehavior.chosen', 'select');
Your solution works. Thank you very much.

Re: Q: How to display a select box (type: list) in a Joomla XML file to meet Joomla 5 standards?

โดย tsukasaz » 27/12/2024 11:34 am

The problem is caused by the JS of Chosen. You need to remove this line.

โค้ด: เลือกทั้งหมด

JHtml::_('formbehavior.chosen', 'select');

Q: How to display a select box (type: list) in a Joomla XML file to meet Joomla 5 standards?

โดย Raja Pdl » 26/12/2024 11:17 pm

In Joomla 5, within a custom component, a type list (select box in an XML file) is not displaying according to Joomla 5 standards. Instead, it appears as a simple HTML select box. How can I fix this to make it display as a Joomla 5 standards select box?

โค้ด: เลือกทั้งหมด

<field 
                name="published" 
                 type="list" 
                 label="JSTATUS" 
                 default="1">
                 <option value="1">JPUBLISHED</option>
                 <option value="0">JUNPUBLISHED</option>
</field>

Actual result
actual res.PNG
actual res.PNG (1.42 KiB) Viewed 2327 times

Expected Result
selct expected.PNG
selct expected.PNG (1.35 KiB) Viewed 2327 times

ข้างบน