EasyUI Forum
January 06, 2026, 10:41:20 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [SOLVED]Change text in menu item by ID  (Read 115 times)
jega
Full Member
***
Posts: 234


View Profile
« on: January 03, 2026, 06:43:07 AM »

Looking for a way to change the text dynamicaly

<div id="menu_setup" class="easyui-menu">
   <div id="upload" data-options="iconCls:'icon-upload'">
      <span>(1) Upload</span>
         <div>
            <div id="objID" data-options="iconCls:'icon-imageupload'">TEXT TO CHANGE</div>
         </div>
   </div>
</div>

Tried $('#objID').html('Changed text') and $('#objID').text('Changed text') whiuch both change the text but now there is no icon class and text starts from icon place. See attachement


Happy New Year

Jesper
« Last Edit: January 04, 2026, 04:18:49 AM by jega » Logged
jega
Full Member
***
Posts: 234


View Profile
« Reply #1 on: January 03, 2026, 04:16:02 PM »

Found solution

var item = $('#menu_setup').menu('findItem', {id:'objID'});
$('#menu_setup').menu('setText', {
   target: item.target,
   text: 'New Text'
})

Or if you want så search by name

var item = $('#menu_setup').menu('findItem', {name:'xxx'});
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!