EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: romach on November 21, 2018, 02:06:33 PM



Title: Change linkbutton text in handler
Post by: romach on November 21, 2018, 02:06:33 PM
I try to change linkbutton text in handler to display status of operation. Text changed but opts.selected is locked as false after that block and cannot be changed anymore:
Code:
...
                        handler:function(){
                            var opts = $(this).linkbutton('options');
                            if(opts.selected) {
                                $(this).linkbutton({ text: 'State 1'});
                            } else {
                                $(this).linkbutton({ text: 'State 2'});
                            }
                         }


Title: Re: Change linkbutton text in handler
Post by: jarry on November 21, 2018, 06:28:13 PM
You can change the 'text' and 'selected' status freely.
Code:
$(this).linkbutton({ text: 'State 1', selected: false});