หน้า 1 จากทั้งหมด 1

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

โพสต์แล้ว: 26/12/2024 11:17 pm
โดย Raja Pdl
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 3772 times

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

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

โพสต์แล้ว: 26/12/2024 11:17 pm
โดย MindPHP Assistant
No response

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

โพสต์แล้ว: 27/12/2024 11:34 am
โดย tsukasaz
The problem is caused by the JS of Chosen. You need to remove this line.

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

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

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

โพสต์แล้ว: 27/12/2024 9:39 pm
โดย Raja Pdl
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.