js := 'Ext.toast(''内容'', ''标题'');';
UniSession.AddJS(js);
procedure toast(content: string; title: string = '');
var
js: string;
begin
js := 'Ext.toast(' + QuotedStr(content) + ',' + QuotedStr(title) + ');';
UniSession.AddJS(js);
end;
显示一秒后自动消失
procedure alertmsg(title, content, ty: string);
var
js: string;
begin
//https://blog.youkuaiyun.com/ranzhifa_2008/article/details/8543429
// icon:设置弹出窗口显示的图标,
//选项有:
//Ext.Msg.INFO(带叹号的图标),
//Ext.Msg.ERROR(带X号的红色图标),
//Ext.Msg.WARNING(带叹号的黄色图标),
//Ext.Msg.QUESTION(带?号的图标)
js := 'Ext.Msg.show({' //
+ 'title:' + QuotedStr(title) + ','//
+ 'msg:' + QuotedStr(content) + ','//
+ 'buttons:' + 'Ext.Msg.OK' + ','//
+ 'icon:' + 'Ext.Msg.' + UpperCase(ty) + ','//
+ '}); ';
UniSession.AddJS(js);
end;
https://www.cnblogs.com/zeng-qh/p/9692345.html
procedure alert(title, content: string);
var
js: string;
begin
js := 'Ext.Msg.alert(' + QuotedStr(title) + ',' + QuotedStr(content) + ');';
UniSession.AddJS(js);
end;
procedure AlertINFO(content: string);
begin
Alertmsg('提示', content, 'INFO');
end;
procedure AlertERROR(content: string);
begin
Alertmsg('错误', content, 'ERROR');
end;
procedure AlertWARNING(content: string);
begin
Alertmsg('警告', content, 'WARNING');
end;
procedure AlertQUESTION(content: string);
begin
Alertmsg('提示', content, 'QUESTION');
end;