在NetSuite中处理\ Animation

问题描述 投票:0回答:1

我有此客户端脚本,该脚本将复制在复制行号中输入的行号,并根据在复制#时间中输入的行数创建新行。当您增加需要复制的行数时,这会花费一些时间。因此,在设置完所有行之前,我们可以给任何处理动画吗,以便用户不必担心吗?copy line

我曾尝试给dialog.create,但没有用。我希望动画能够一直保持到脚本执行完毕并停止为止。

var options = {
                    title: 'Alert',
                    message: 'Processing. Please wait.',
                     buttons: [{
                     label: 'OKK...',
                     value: 1
                     },
                     ]
                    };
                    dialog.create(options).then(success)
                    return (true);

成功是我正在调用的函数。

netsuite suitescript2.0
1个回答
0
投票

N/ui/dialog模块用于显示可忽略的消息,并且对于进度条实际上是行不通的,因为您无法隐藏按钮,也无法通过代码将其关闭。我建议看一下第三方库。 SweetAlert2是非常受欢迎的一个,并且NetSuite Professionals站点上有some sample code可以与NetSuite一起使用。

如果您只想快速攻克,您可以仅使用了NetSuite默认在所有页面上包括的Ext.js library。但是,我强烈建议您不要对任何生产代码执行此操作,因为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()
© www.soinside.com 2019 - 2024. All rights reserved.