Jump to content

ToolTip for rows in UniDBGrid


artem_niko

Recommended Posts

image.png.1d11e0e7dbe0cc9f579ffa3d4e707958.png

https://financeiro.app 

Add in UniDBGrid -> ClientEvents.ExtEvents.Values['viewready'] 
Sample:

  dbg.ClientEvents.ExtEvents.Values['viewready'] :=
    'function viewready(sender, eOpts) '+
    '{ '+
    '    sender.view.tip = Ext.create(''Ext.tip.ToolTip'', { '+
    '        target: sender.view.el,'+
    '        delegate: sender.view.cellSelector, '+
    '        trackMouse: true, '+
    '        showDelay: 50, '+
    '        hideDelay: 50, '+
    '        renderTo: Ext.getBody(), '+
    '        listeners: { '+
    '            beforeshow: function updateTipBody(tip) { '+
    '                gridColums = sender.view.getGridColumns(); '+
    '                column = gridColums[tip.triggerElement.cellIndex]; '+

    '                record = sender.view.getRecord(tip.triggerElement.parentNode); '+

    '                if (column.dataIndex == ''3'') { '+
    '                    tip.update('' '+
    '                              <b>Descrição</b> '' + record.data[parseInt(3)] + '' </br> '+
    '                              <b>Categoria de Despesa</b> '' + record.data[parseInt(11)] + ''  '+
    '                               ''); '+
    '                } else { '+
    '                    return false; '+
    '                } '+
    '            } '+
    '        } '+
    '    }); '+
    '} ';

 

Link to comment
Share on other sites

20 minutes ago, Marlon Nardi said:

image.png.1d11e0e7dbe0cc9f579ffa3d4e707958.png

 

Add in UniDBGrid -> ClientEvents.ExtEvents.Values['viewready'] 
Sample:


  dbg.ClientEvents.ExtEvents.Values['viewready'] :=
    'function viewready(sender, eOpts) '+
    '{ '+
    '    sender.view.tip = Ext.create(''Ext.tip.ToolTip'', { '+
    '        target: sender.view.el,'+
    '        delegate: sender.view.cellSelector, '+
    '        trackMouse: true, '+
    '        showDelay: 50, '+
    '        hideDelay: 50, '+
    '        renderTo: Ext.getBody(), '+
    '        listeners: { '+
    '            beforeshow: function updateTipBody(tip) { '+
    '                gridColums = sender.view.getGridColumns(); '+
    '                column = gridColums[tip.triggerElement.cellIndex]; '+

    '                record = sender.view.getRecord(tip.triggerElement.parentNode); '+

    '                if (column.dataIndex == ''3'') { '+
    '                    tip.update('' '+
    '                              <b>Descrição</b> '' + record.data[parseInt(3)] + '' </br> '+
    '                              <b>Categoria de Despesa</b> '' + record.data[parseInt(11)] + ''  '+
    '                               ''); '+
    '                } else { '+
    '                    return false; '+
    '                } '+
    '            } '+
    '        } '+
    '    }); '+
    '} ';

 

Oi Marlon, ótima dica essa...

Eu queria saber se tem como fazer uma alteração da seguinte forma, tenho um grid com 10 colunas ai quero deixar as colunas invisíveis a partir da 5º, ai eu queria colocar essa dica nas colunas visíveis. Entendeu?

 

Link to comment
Share on other sites

2 minutes ago, eduardosuruagy said:

Oi Marlon, ótima dica essa...

Eu queria saber se tem como fazer uma alteração da seguinte forma, tenho um grid com 10 colunas ai quero deixar as colunas invisíveis a partir da 5º, ai eu queria colocar essa dica nas colunas visíveis. Entendeu?

Sim você consegue fazer com este mesmo exemplo, você vai utilizar o index de sua Column, neste seu caso o index vai iniciar na posição 5
--
If you can do the same example, you can use your column index, in which case the index will start at position 5

    '                if (column.dataIndex == ''5'') { '+
    '                    tip.update('' '+
    '                              <b>Descrição Coluna 5</b> '' + record.data[parseInt(5)] + '' '+
    '                               ''); '+
    '                } '+

    '                if (column.dataIndex == ''6'') { '+
    '                    tip.update('' '+
    '                              <b>Descrição Coluna 6</b> '' + record.data[parseInt(6)] + '' '+
    '                               ''); '+
    '                } '+


 

Link to comment
Share on other sites

4 minutes ago, Marlon Nardi said:

Sim você consegue fazer com este mesmo exemplo, você vai utilizar o index de sua Column, neste seu caso o index vai iniciar na posição 5
--
If you can do the same example, you can use your column index, in which case the index will start at position 5


    '                if (column.dataIndex == ''5'') { '+
    '                    tip.update('' '+
    '                              <b>Descrição Coluna 5</b> '' + record.data[parseInt(5)] + '' '+
    '                               ''); '+
    '                } '+

    '                if (column.dataIndex == ''6'') { '+
    '                    tip.update('' '+
    '                              <b>Descrição Coluna 6</b> '' + record.data[parseInt(6)] + '' '+
    '                               ''); '+
    '                } '+


 

Eu queria fazer de uma forma dinâmica, tipo assim, qd abrir no celular ou tablet eu iria deixar as colunas invisíveis e mostrar elas como uma dica. 

Exemplo: Tenho um grid com 10 colunas ai quando abro no tablet eu deixaria as 5 primeiras colunas visíveis e as outras 5 eu colocaria elas como uma dica. Sendo que isso eu tenho que fazer em vários grids ai se conseguisse colocar no formulário padrão seria melhor. 

 

 

Link to comment
Share on other sites

3 minutes ago, eduardosuruagy said:

Eu queria fazer de uma forma dinâmica, tipo assim, qd abrir no celular ou tablet eu iria deixar as colunas invisíveis e mostrar elas como uma dica. 

Exemplo: Tenho um grid com 10 colunas ai quando abro no tablet eu deixaria as 5 primeiras colunas visíveis e as outras 5 eu colocaria elas como uma dica. Sendo que isso eu tenho que fazer em vários grids ai se conseguisse colocar no formulário padrão seria melhor. 

Neste caso você também consegue, porém irá ter que fazer de forma manual
-
In this case you can do it too, but you will have to do it manually

    '                if (column.dataIndex == ''1'') { '+
    '                    tip.update('' '+
    '                              <b>Dica 5</b> '' + record.data[parseInt(5)] + '' </br> '+
    '                              <b>Dica 6</b> '' + record.data[parseInt(6)] + '' </br> '+
    '                               ''); '+
    '                }'+


 

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