File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 4747 var data = JSON . parse ( response ) ;
4848 var list = document . querySelectorAll ( '#jform_parent_id option' ) ;
4949 list . forEach ( function ( item ) {
50- if ( item ! = '1' ) {
50+ if ( item . value != = '1' ) {
5151 item . remove ( ) ;
5252 }
5353 } ) ;
5454
5555 data . forEach ( function ( val ) {
5656 var option = document . createElement ( 'option' ) ;
57- option . innerText = value ;
57+ option . innerText = val . title ;
5858 option . id = val . id ;
5959 document . getElementById ( 'jform_parent_id' ) . appendChild ( option ) ;
6060 } ) ;
61- document . getElementById ( 'jform_parent_id' ) . trigger ( 'change' ) ;
61+
62+ var event = document . createEvent ( 'HTMLEvents' ) ;
63+ event . initEvent ( 'change' , true , false ) ;
64+ document . getElementById ( 'jform_parent_id' ) . dispatchEvent ( event ) ;
6265 } ,
6366 onError : function ( xhr ) {
6467 Joomla . renderMessages ( Joomla . ajaxErrorsMessages ( xhr ) ) ;
You can’t perform that action at this time.
0 commit comments