Jump to content

How can I get a hint in the cells of the stringgrid?


eduardosuruagy

Recommended Posts

16 hours ago, eduardosuruagy said:

Can you do that?

Maybe you wanted like this?

UniStringGrid -> ClientEvents -> ExtEvents -> function afterrender:

function afterrender(sender, eOpts) 
{
    var me = sender;
    var view = me.normalGrid.getView();
    view.tip = Ext.create('Ext.tip.ToolTip', {
        target: view.getId(),
        delegate: '.x-grid-cell',
        trackMouse: true,
        listeners: {
            beforeshow: function updateTipBody(tip) {
                var tipGridView = tip.target.component;
                var record = tipGridView.getRecord(tip.triggerElement);
                tip.update(record.get(tip.triggerElement.cellIndex + me.lockedGrid.getColumns().length));
            }
        }
    });
}

 

Link to comment
Share on other sites

5 hours ago, Sherzod said:

Maybe you wanted like this?

UniStringGrid -> ClientEvents -> ExtEvents -> function afterrender:


function afterrender(sender, eOpts) 
{
    var me = sender;
    var view = me.normalGrid.getView();
    view.tip = Ext.create('Ext.tip.ToolTip', {
        target: view.getId(),
        delegate: '.x-grid-cell',
        trackMouse: true,
        listeners: {
            beforeshow: function updateTipBody(tip) {
                var tipGridView = tip.target.component;
                var record = tipGridView.getRecord(tip.triggerElement);
                tip.update(record.get(tip.triggerElement.cellIndex + me.lockedGrid.getColumns().length));
            }
        }
    });
}

 

 

It's almost what I wanted, in fact I created a calendar with the StringGrid and I would like it on some dates when I hover over it to show the description of what is registered in the database, such as a birthday or a holiday. This information who registers is the user.

 

Link to comment
Share on other sites

11 minutes ago, eduardosuruagy said:

It's almost what I wanted, in fact I created a calendar with the StringGrid and I would like it on some dates when I hover over it to show the description of what is registered in the database, such as a birthday or a holiday. This information who registers is the user.

OK

Link to comment
Share on other sites

20 hours ago, eduardosuruagy said:

How can someone help me please?

Hi,

Sorry for the late reply, need to analyze

On 4/25/2019 at 5:16 PM, eduardosuruagy said:

It's almost what I wanted, in fact I created a calendar with the StringGrid and I would like it on some dates when I hover over it to show the description of what is registered in the database, such as a birthday or a holiday. This information who registers is the user.

This explanation is not very clear to me. 

You may need to make a test case by specifying a sequence of actions...

Link to comment
Share on other sites

image.thumb.png.951c28cedc75697f1b42ac0c17c9d261.png

 

I made a calendar using StringGrdi and I logged in a table from my database a few holidays, I would like to give a select on my table and on the respective dates I put a hint with the holiday description.

As it is in the attached image, the cells in red are holidays, when I hover the mouse over it I wanted it to show the name of the holiday!

 

Link to comment
Share on other sites

1 hour ago, eduardosuruagy said:

I would just like an answer from the staff if this is possible to do or not ...

I'm sorry for the late reply

It's possible, But for this need to take into account a few points, I will try to make a simple testcase one of these days

Link to comment
Share on other sites

11 hours ago, eduardosuruagy said:

Is the forum support gone? Not even to give a simple answer stating that you can not do it, we have to wait 30 days for an answer?

Hi,

I'm sorry, forum support does not mean to fully resolve your requests.
As I said above, that this is possible, and that was my opinion.
And I apologize again for not being able to give you a test case for this at the moment

Link to comment
Share on other sites

55 minutes ago, Sherzod said:

Oi,

Desculpe, o suporte do fórum não significa resolver totalmente suas solicitações.
Como eu disse acima, isso é possível, e essa foi a minha opinião.
E peço desculpas novamente por não ser capaz de lhe dar um caso de teste para isso no momento

Still, thank you very much for your help!

Link to comment
Share on other sites

  • 10 months later...
7 hours ago, MOGSY said:

It is very usful if possible to pass the text to be displayed to tool tip dynamically.

Hi,

Something like this.

function afterrender(sender, eOpts)
{
    var me = sender;
    var view = me.normalGrid.getView();
    view.tip = Ext.create('Ext.tip.ToolTip', {
        target: view.getId(),
        delegate: '.x-grid-cell',
        trackMouse: true,
        listeners: {
            beforeshow: function updateTipBody(tip) {
                return me.cellTip ? tip.update(me.cellTip) : false;
            }
        }
    });
}
procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  UniStringGrid1.JSInterface.JSProperty('cellTip', ['tip']);
end;
procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniStringGrid1.JSInterface.JSAssign('cellTip', ['tip1']);
end;

But you also need to think about these form events:
deactivate and activate, which are called upon activation, deactivation tooltip!

Link to comment
Share on other sites

7 hours ago, Sherzod said:

Hi,

Something like this.


function afterrender(sender, eOpts)
{
    var me = sender;
    var view = me.normalGrid.getView();
    view.tip = Ext.create('Ext.tip.ToolTip', {
        target: view.getId(),
        delegate: '.x-grid-cell',
        trackMouse: true,
        listeners: {
            beforeshow: function updateTipBody(tip) {
                return me.cellTip ? tip.update(me.cellTip) : false;
            }
        }
    });
}

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  UniStringGrid1.JSInterface.JSProperty('cellTip', ['tip']);
end;

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniStringGrid1.JSInterface.JSAssign('cellTip', ['tip1']);
end;

But you also need to think about these form events:
deactivate and activate, which are called upon activation, deactivation tooltip!

Obrigado!!

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