artem_niko Posted March 21, 2020 Share Posted March 21, 2020 Hello! I want show hint for every row in UniDBGrid. For example: I want show anouther text in tooltip As is (for emaple): How do this? 1 Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted March 21, 2020 Share Posted March 21, 2020 +1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 21, 2020 Share Posted March 21, 2020 5 hours ago, Артем said: I want show anouther text in tooltip Hello, Do you want to show static data? Date and time? Quote Link to comment Share on other sites More sharing options...
MarkB Posted March 21, 2020 Share Posted March 21, 2020 41 minutes ago, Sherzod said: Hello, Do you want to show static data? Date and time? I'd like tooltips for the DBGrid too. In my case, I want dynamic data column by column and row by row. Quote Link to comment Share on other sites More sharing options...
picyka Posted March 21, 2020 Share Posted March 21, 2020 It is interesting when it doesn't show all the information in the column, it could be a property in the grid column. Quote Link to comment Share on other sites More sharing options...
Marlon Nardi Posted March 21, 2020 Share Posted March 21, 2020 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; '+ ' } '+ ' } '+ ' } '+ ' }); '+ '} '; Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted March 21, 2020 Share Posted March 21, 2020 20 minutes ago, Marlon Nardi said: 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? Quote Link to comment Share on other sites More sharing options...
Marlon Nardi Posted March 21, 2020 Share Posted March 21, 2020 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)] + '' '+ ' ''); '+ ' } '+ Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted March 21, 2020 Share Posted March 21, 2020 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. Quote Link to comment Share on other sites More sharing options...
Marlon Nardi Posted March 21, 2020 Share Posted March 21, 2020 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> '+ ' ''); '+ ' }'+ Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted March 21, 2020 Share Posted March 21, 2020 Valeu Marlon pela dica... Quote Link to comment Share on other sites More sharing options...
MOGSY Posted March 24, 2020 Share Posted March 24, 2020 Hi How can it display the hiden columns? If the column is hiden is showing undefined. Regards Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.