Jump to content

How to invert TUniTrackBar Min and Max


nimarufa

Recommended Posts

Hello,

You can use this trick, I think :)

1. UniTrackBar1 -> ClientEvents -> UniEvents -> function beforeInit:

function beforeInit(sender, config)
{
    config.plugins = new Ext.slider.Tip({
        getText: function(thumb){
             return Ext.String.format('{0}', sender.maxValue - thumb.value);
        }
    })
}

2. On the server side, something like this:

Inverted value ->

UniTrackBar1.Max - UniTrackBar1.Position

 

Link to comment
Share on other sites

19 hours ago, nimarufa said:

How can I set custom Tip string from the server side

Hi,

Something like this:

1.

function beforeInit(sender, config)
{
    config.tipTemplate = '{0}';
    
    config.plugins = new Ext.slider.Tip({
        getText: function(thumb){
             return Ext.String.format(sender.tipTemplate, sender.maxValue - thumb.value);
        }
    });
}

2. On the server side:

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniTrackBar1.JSInterface.JSAssign('tipTemplate', ['{0}% complete'])
end;

 

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