API: How to update a progress bar?
144 2
andreasbernhofer 5 months ago
Hi, how do I update the value of a progress bar? ``` js // Test #1 x = $.messager.progress({ title: "Processing", value: 5, text: "{value}%", interval: 0, closable: true }); x.progressbar(); x.progressbar('setValue',50); // Test #2 x = $.messager.progress({ title: "Processing", value: 5, text: "{value}%", interval: 0, closable: true }); x.progressbar({value: 50}); ``` Both kind of work but mess with the layout... ![2020-11-15 10_21_02-Window.png](//image.easyeda.com/pullimage/DG8c3ABggB7bTump4gDsaOh7YRpdJ1JAWNFFMdsR.png)
Comments
eric 3 months ago
The key point is how to find the progressbar component. ``` //The dialog component var dialog = $.messager.progress({ title: "Processing", value: 5, text: "{value}%", interval: 0, closable: true }); //The progressbar component in the dialog var bar = $.messager.progress('bar', dialog); //There are 2 ways to update the progress value //1. Use setValue bar.progressbar('setValue', 25); //2. Or use stepToValue bar.progressbar('stepToValue', 75); ```
Reply
andreasbernhofer 3 months ago
@eric perfect thx!
Reply
Login or Register to add a comment
goToTop
你现在访问的是EasyEDA海外版,使用建立访问速度更快的国内版 https://lceda.cn(需要重新注册)
如果需要转移工程请在个人中心 - 工程 - 工程高级设置 - 下载工程,下载后在https://lceda.cn/editor 打开保存即可。
有问题联系QQ 3001956291 不再提醒
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow
We use cookies to offer you a better experience. Detailed information on the use of cookies on this website is provided in our Privacy Policy. By using this site, you consent to the use of our cookies.