Jump to content

Simple TIP: Tools usage demo


Recommended Posts

  • 1 year later...

Hi, 

 

Very cool, 
 
In unigui beta version 0.95.0.1046 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);
begin
  if EventName='tool' then
    ShowMessage('Button '+Params.Values['btn']+' pressed');
 
end;

 

 

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

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...