netsuite - Processing \Animation in NetSuite
问题描述
I have this client script which copies the line number entered in Copy line# and creates new lines from number of lines entered in Copy #Times. This thing takes time when you increase the number of lines you require to copy. So can we give any processing animation till all the lines are set so user dont have to worry?
I have tried giving dialog.create but it didnt work. I want the animation to stay until script is executing and after that stop.
var options = {
title: 'Alert',
message: 'Processing. Please wait.',
buttons: [{
label: 'OKK...',
value: 1
},
]
};
dialog.create(options).then(success)
return (true);
success is a function I am calling.
解决方案
该N/ui/dialog
模块旨在显示可关闭的消息,并且不适用于进度条,因为您无法隐藏按钮,也无法通过代码关闭它。我建议查看第三方库。一个非常流行的是SweetAlert2,在 NetSuite Professionals 网站上有一些示例代码用于将它与 NetSuite 一起使用。
如果你只是想快速破解,你可以使用NetSuite 默认包含在所有页面上的Ext.js 库。但是,我强烈建议不要对任何生产代码这样做,因为 NetSuite 可以在以后的升级中随时更新或删除它。
var messageBox = Ext.MessageBox.show({
title: 'Lines are being copied...',
msg: 'This may take a couple minutes',
wait: true,
width: 250
});
// your work here
messageBox.hide()
推荐阅读
- flutter - 如果至少选择了一个复选框,如何激活按钮?- 颤振
- azure-data-factory - 将 Parquet 文件加载到 Azure Synapse 时失败
- css - Bootstrap Cards - 第三张卡片不高于同一行中的其他 2 张卡片
- javascript - 请求成功时 axios 响应数据未定义
- python - 获取“Django 只能处理 ASGI/HTTP 连接,不能处理 websocket。” 在heroku上托管ASGI时出错?
- javascript - 如何推送到 [] 类型的猫鼬模式属性
- java - 如何使用我的应用程序用户的 Google 帐户进行地图 API 调用?
- javascript - Jodit 反应编辑器失去了对 onchange 方法的关注
- cumulative-layout-shift - 如何验证加载和移动?
- java - 局部变量的值未使用错误显示在“字符串计划;”