Jump to content

How to customize Ext.toast


Mehmet Emin

Recommended Posts

1 minute ago, Sherzod said:

Possible values:

  • br - bottom-right
  • bl - bottom-left
  • tr - top-right
  • tl - top-left
  • t - top
  • l - left
  • b - bottom
  • r - right

yes , i try with align:r

but the toast is not show 

nothing error in console tab

i use unigui ver 1541 , extjs 7.0.0,

 

Link to comment
Share on other sites

procedure TMainForm.UniButton1Click(Sender: TObject);
var
  acol,
  apesan,
  amsg: string;
  genMsgID: string;
begin

  amsg := 'Hello';
  acol:='#3D7A00';
  genMsgID := FormatDateTime('yyyymmddhhnnsszzz', Now());

  apesan := apesan+'<table style=margin-top:-18px ><td><i class=\"fa fa-info\" aria-hidden=\"true\">   </i>     &nbsp;&nbsp;&nbsp; </td>&nbsp;&nbsp;<td>'+amsg +'</td></table><span style=\"float:right;margin-top:-18px\"><i  onclick=\"window._msg'+ genMsgID +'.destroy(); window._msg'+genMsgID+'=null; \"   class=\"fa fa-times\" aria-hidden=\"true\"></i></span>';

  UniSession.AddJS('window._msg'+ genMsgID +' = Ext.toast ({html: "<font color=white style=font-size:15px;font-family:segoe ui;>' + apesan +
   '</font>", align: "tr" , header: false, width:400, autoCloseDelay: 150000, hideDuration: 150000, modal: false, bodyStyle:{"background-color":"'+acol+' !important;box-shadow:'+acol+' !important; border-color: 0px solid transparent;padding:0px 0px 0px 0px !important;top:180px !important"}'
   +',listeners: {show: function(){this.paddingY = Ext.getBody().getHeight()/2 - this.getHeight()/2}}'
   +'});'
   );

end;

 

Link to comment
Share on other sites

50 minutes ago, Sherzod said:
procedure TMainForm.UniButton1Click(Sender: TObject);
var
  acol,
  apesan,
  amsg: string;
  genMsgID: string;
begin

  amsg := 'Hello';
  acol:='#3D7A00';
  genMsgID := FormatDateTime('yyyymmddhhnnsszzz', Now());

  apesan := apesan+'<table style=margin-top:-18px ><td><i class=\"fa fa-info\" aria-hidden=\"true\">   </i>     &nbsp;&nbsp;&nbsp; </td>&nbsp;&nbsp;<td>'+amsg +'</td></table><span style=\"float:right;margin-top:-18px\"><i  onclick=\"window._msg'+ genMsgID +'.destroy(); window._msg'+genMsgID+'=null; \"   class=\"fa fa-times\" aria-hidden=\"true\"></i></span>';

  UniSession.AddJS('window._msg'+ genMsgID +' = Ext.toast ({html: "<font color=white style=font-size:15px;font-family:segoe ui;>' + apesan +
   '</font>", align: "tr" , header: false, width:400, autoCloseDelay: 150000, hideDuration: 150000, modal: false, bodyStyle:{"background-color":"'+acol+' !important;box-shadow:'+acol+' !important; border-color: 0px solid transparent;padding:0px 0px 0px 0px !important;top:180px !important"}'
   +',listeners: {show: function(){this.paddingY = Ext.getBody().getHeight()/2 - this.getHeight()/2}}'
   +'});'
   );

end;

 

 it's work perfectly , thanks you very much @Sherzod

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...