EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: frankz on November 08, 2016, 01:09:50 AM



Title: widgets creation with javascript
Post by: frankz on November 08, 2016, 01:09:50 AM
I have problems with the creation of widgets using javascript.
taking for example the linkbutton, with markdown mosta me icon, and with no javascript.
I copied verbatim the related tutorial code, let me know where I'm wrong.
you can have a code sample to set the properties, events and methods (I admit that I'm ignorant on the use of javascript)?
thanks for help


Title: Re: widgets creation with javascript
Post by: stworthy on November 08, 2016, 08:53:38 PM
You can create any components with javascript. The code below shows how to create a linkbutton.
Code:
<a id="btn1" href="#"></a>
<script>
$(function(){
$('#btn1').linkbutton({
text: 'Button',
iconCls: 'icon-help',
onClick: function(){
//...
}
})
})
</script>


Title: Re: widgets creation with javascript
Post by: frankz on November 09, 2016, 02:56:18 AM
OK, it works.
now I understand where wrong.
thank you