Jump to content

edit's with button


jahlxx

Recommended Posts

Ok.

 

I thought this before.

 

But have many buttons in the form and I must be ocupped in alignment,m etc.

 

In labels I do this:

 

tunilabel.TextConversion:=txtHTML;
tunilabel.caption := tunilabel.caption +  '  <img src="files/someimage.jpg"  border="0" width="10" height="10"';

 

 

This works fine, and I'm looking for the way to do the same with uniedit, uninumberedit, and similar components.

 

Thanks.
 

Link to comment
Share on other sites

Ok. Thanks.

 

I'll wait.

 

Other thing I've tried is:

 

   uniedit.fieldlabelseparator := ' ';
   uniedit.fieldlabelwidth := 10;
   uniedit.fieldlabel := '<img src="files/someimage.jpg"  border="0" width="10" height="10"';

 

But have some problems:

- width of the field is reduced

- allways appears the icon in left side

- can't control the click event in the image

 

I'll wait some solution. Thanks.

Link to comment
Share on other sites

Hi,

 

Sorry for late reply

 

One of the possible solution, but after porting to ExtJS6 it is very easy to do, with triggers config...

 

UniEdit1 -> ....

function afterrender(sender, eOpts)
{
    var me=sender;
    me.triggerButtonEl = me.bodyEl.createChild({
        tag: 'button'
    });
    
    me.triggerButtonEl.setStyle('position', 'absolute');
    me.triggerButtonEl.setStyle('top', '0px');
    me.triggerButtonEl.setStyle('right', '0px');
    me.triggerButtonEl.setStyle('left', 'auto');
    me.triggerButtonEl.setStyle('height', '100%');
    
    me.triggerButtonEl.addListener('click', function(){
        //ajaxRequest(me, 'clicked', []);
    });
    
    me.inputEl.setStyle('padding-right', me.triggerButtonEl.getWidth()+1);
}

Best regards,

  • Thanks 1
Link to comment
Share on other sites

  • 6 months later...
  • 1 year later...
On 10/17/2017 at 10:11 AM, Sherzod said:

Hi,

 

Sorry for late reply

 

One of the possible solution, but after porting to ExtJS6 it is very easy to do, with triggers config...

 

UniEdit1 -> ....


function afterrender(sender, eOpts)
{
    var me=sender;
    me.triggerButtonEl = me.bodyEl.createChild({
        tag: 'button'
    });
    
    me.triggerButtonEl.setStyle('position', 'absolute');
    me.triggerButtonEl.setStyle('top', '0px');
    me.triggerButtonEl.setStyle('right', '0px');
    me.triggerButtonEl.setStyle('left', 'auto');
    me.triggerButtonEl.setStyle('height', '100%');
    
    me.triggerButtonEl.addListener('click', function(){
        //ajaxRequest(me, 'clicked', []);
    });
    
    me.inputEl.setStyle('padding-right', me.triggerButtonEl.getWidth()+1);
}

Best regards,

How can I set the iconCls of this Button in afterrender function?

Link to comment
Share on other sites

5 hours ago, brunomf01 said:

How can I set the iconCls of this Button in afterrender function?

Like this for example:

function afterrender(sender, eOpts)
{
    var me=sender;
    me.triggerButtonEl = me.bodyEl.createChild({
        tag: 'button',
        html: '<i class="fa fa-search fa" style="position:relative; color:grey;"></i>'
    });
    
    me.triggerButtonEl.setStyle('position', 'absolute');
    me.triggerButtonEl.setStyle('top', '0px');
    me.triggerButtonEl.setStyle('right', '0px');
    me.triggerButtonEl.setStyle('left', 'auto');
    me.triggerButtonEl.setStyle('height', '100%');
    
    me.triggerButtonEl.addListener('click', function(){
        //ajaxRequest(me, 'clicked', []);
    });
    
    me.inputEl.setStyle('padding-right', me.triggerButtonEl.getWidth()+1);
}

 

  • Thanks 1
Link to comment
Share on other sites

On 1/14/2020 at 12:59 AM, Sherzod said:

Like this for example:


function afterrender(sender, eOpts)
{
    var me=sender;
    me.triggerButtonEl = me.bodyEl.createChild({
        tag: 'button',
        html: '<i class="fa fa-search fa" style="position:relative; color:grey;"></i>'
    });
    
    me.triggerButtonEl.setStyle('position', 'absolute');
    me.triggerButtonEl.setStyle('top', '0px');
    me.triggerButtonEl.setStyle('right', '0px');
    me.triggerButtonEl.setStyle('left', 'auto');
    me.triggerButtonEl.setStyle('height', '100%');
    
    me.triggerButtonEl.addListener('click', function(){
        //ajaxRequest(me, 'clicked', []);
    });
    
    me.inputEl.setStyle('padding-right', me.triggerButtonEl.getWidth()+1);
}

 

how can i pass this code at runtime.
I can't make it work with dynamic component creation

Link to comment
Share on other sites

  • 1 year later...
On 1/14/2020 at 11:59 AM, Sherzod said:

Like this for example:

function afterrender(sender, eOpts)
{
    var me=sender;
    me.triggerButtonEl = me.bodyEl.createChild({
        tag: 'button',
        html: '<i class="fa fa-search fa" style="position:relative; color:grey;"></i>'
    });
    
    me.triggerButtonEl.setStyle('position', 'absolute');
    me.triggerButtonEl.setStyle('top', '0px');
    me.triggerButtonEl.setStyle('right', '0px');
    me.triggerButtonEl.setStyle('left', 'auto');
    me.triggerButtonEl.setStyle('height', '100%');
    
    me.triggerButtonEl.addListener('click', function(){
        //ajaxRequest(me, 'clicked', []);
    });
    
    me.inputEl.setStyle('padding-right', me.triggerButtonEl.getWidth()+1);
}

 

How can I add hint or tool tip on the button?

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