PDA

View Full Version : Help GridCommand



hbbazan
Feb 09, 2010, 1:56 PM
Hi,

I need change the visibility of a item of the gridCommand, but I need do it in the server-side.



<ext:GridPanel ID="grdProjetos" Icon="Brick" runat="server" StoreID="strProjetos"
StripeRows="true" Title="Lista de Projetos" TrackMouseOver="true" Height="400"
AutoExpandColumn="clDescricao">
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ColumnID="clId" Header="Identificação" Hidden="true" DataIndex="id" />
<ext:Column ColumnID="clTitulo" Header="Título" Width="200" DataIndex="titulo" />
<ext:Column ColumnID="clDescricao" Header="Descricão" DataIndex="descricao" />
<ext:Column ColumnID="clSituacao" Header="Situacão" Width="150" DataIndex="situacao" />
<ext:CommandColumn Width="115" Align="Center" Header="Ações">
<Commands>
<ext:GridCommand Icon="ApplicationFormEdit" CommandName="editar" ToolTip-Text="Editar" />
<ext:GridCommand Icon="BulletTick" CommandName="concluir" ToolTip-Text="Concluir" />
<ext:GridCommand Icon="BulletStop" CommandName="cancelar" ToolTip-Text="Cancelar" />
<ext:GridCommand Icon="Comments" CommandName="comentarios" ToolTip-Text="Comentários" />
<ext:GridCommand Icon="Delete" CommandName="excluir" ToolTip-Text="Excluir" />
</Commands>
</ext:CommandColumn>
</Columns>
</ColumnModel>
<Listeners>
<Command Handler="acao(command, record)" />
</Listeners>
<BottomBar>
<ext:PagingToolbar ID="PagingToolBar1" runat="server" PageSize="10" StoreID="strProjetos" />
</BottomBar>
<LoadMask ShowMask="true" />
<Buttons>
<ext:Button ID="btnNovo" Text="Novo" runat="server" OnClientClick="$E('ctl00_cnpConteudo_winCadProjeto').show();$E('c tl00_cnpConteudo_hdfId').setValue('');">
</ext:Button>
</Buttons>
</ext:GridPanel>


In the code above, I need the first column (CommandName="editar") of the gridCommand be invisible. How can I do it?

Thank you.

hbbazan
Feb 10, 2010, 12:52 PM
Is possible set visibile false to a full column of the gridCommand?

thank you.

hbbazan
Feb 24, 2010, 3:47 PM
Hi,

I can not do it at all...........please anyone help me.

thanks

geoffrey.mcgill
Feb 24, 2010, 3:57 PM
You should be able to set Hidden="true" to hide the Button.

hbbazan
Feb 24, 2010, 4:08 PM
Hi,

sorry, but how can I do it? because I need do it in server-side and I need to hide or set visible false just in one column of my
CommandColumn, undestood?

example:

Users Actions
<div align="left">Henrique Edit Exclude
<div align="left">João Edit Exclude

Sérgio Edit Exclude
Mário Edit Exclude
Paulo Edit Exclude

Above, for example, I need to hide just one gridComand of my CommandColumn.........I need to hide the "Edit" and the gridCommand "Exclude" should continue on my CommandColumn! correct? Can I do it?

thanks

hbbazan
Mar 01, 2010, 8:59 AM
Please helpe me, I need it so much and I have no ideia how to do...

thanks for attention,
bye.

Vladimir
Mar 01, 2010, 9:04 AM
Hi,

The following example shows how to disable command, the same way you can hide it
http://examples1.ext.net/#/GridPanel/Commands/Prepare_Toolbar/

hbbazan
Mar 01, 2010, 9:28 AM
Yes it works, but for each column line in the grid it will call this funciotn, correct?

Don't have one way to hide the full column..........if I have one column "Edit" and other "Exclude", I want to hide the full column "Edit"................one time, without call one function for each line of register in my grid

thanks for help.

Vladimir
Mar 01, 2010, 9:50 AM
Hi,

Use 'setHidden' method of the column model

grid.getColumnModel().setHidden(0, true);

hbbazan
Mar 01, 2010, 10:19 AM
Hi, I tried it, but didn't solved my problem

I have one "CommandColumn" with "Commands" and I want to hide just one of my "Commands", how could be?



<ext:CommandColumn Width="115" Align="Center" Header="Ações">
<Commands>
<ext:GridCommand Icon="ApplicationFormEdit" CommandName="editar" ToolTip-Text="Editar" />
<ext:GridCommand Icon="BulletTick" CommandName="confirmarPresenca" ToolTip-Text="Confirmar presença" />
<ext:GridCommand Icon="BulletRed" CommandName="cancelarPresenca" ToolTip-Text="Cancelar presença" />
<ext:GridCommand Icon="PagePortraitShot" CommandName="listaDeConfirmacoes" ToolTip-Text="Lista de presença" />
<ext:GridCommand Icon="Delete" CommandName="excluir" ToolTip-Text="Excluir" />
</Commands>
</ext:CommandColumn>
</Columns>


I tried it:



$E("ctl00_cnpConteudo_grdReunioesAssembleias").getColumnModel().setHidden(0, true);




$E("ctl00_cnpConteudo_grdReunioesAssembleias").getColumnModel().columns[6].commands.remove[0];




$E("ctl00_cnpConteudo_grdReunioesAssembleias").colModel.columns[6].commands.remove[0];



the first worked, but all commnad of my commancolumn were hidden.

the others didn't worked.

thanks.

joao.msdn
Mar 02, 2010, 12:43 PM
Wow, I'm with the same problem

Is it possible to solve?

Thanks

hbbazan
Mar 05, 2010, 2:30 PM
Did you have any progress?

thanks