Jump to content

Simple TIP: Tools usage demo

Recommended Posts

  • 1 year later...



Very cool, 
In unigui beta version not work, so based on that, I made a small adjustment to function properly: 
In the Form ClientEvents.UniEvents 
Create a beforeInit event, the contents of this event should look like this:


function window.beforeInit(sender)
   Ext.apply (sender, {
          tools: [{ 
          type: 'pin',
          tooltip: 'tooltip of pin',
          handler: function(event, toolEl, panel){
               ajaxRequest(sender, 'tool', [ 'btn=pin' ] );
           type: 'refresh',
           tooltip: 'tooltip of refresh',
           handler: function(event, toolEl, panel){  
               ajaxRequest(sender, 'tool', [ 'btn=refresh' ] );
           type: 'search', 
           tooltip: 'tooltip of search',
           handler: function(event, toolEl, panel){
                ajaxRequest(sender, 'tool', [ 'btn=search' ] );
           type: 'save',
           tooltip: 'tooltip of save',
           handler: function(event, toolEl, panel){
               ajaxRequest(sender, 'tool', [ 'btn=save' ] );



And OnAjaxEvent event look like this:


procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string;
  Params: TStrings);
  if EventName='tool' then
    ShowMessage('Button '+Params.Values['btn']+' pressed');



I have helped those who had the same problem I had. Hugs!

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.

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...