PDA

View Full Version : [CLOSED] RowSelectionModel not works for ComponentColumn



Mario
Jan 05, 2015, 4:25 PM
The code:



<ext:GridPanel runat="server" ID="GridPanelRisultatoRicerca" MarginSpec="2 0 0 0" Flex="1" Border="true">
<Store>
<ext:Store runat="server" ID="StoreRisultatoRicerca">
<Model>
<ext:Model runat="server" ID="ModelRisultatoRicerca" IDProperty="CodiceUtente">
<Fields>
<ext:ModelField Name="CodiceTipoUtente" Type="String" />
<ext:ModelField Name="CodiceUtente" Type="String" />
<ext:ModelField Name="Cognome" Type="String" />
<ext:ModelField Name="Nome" Type="String" />
<ext:ModelField Name="RagioneSociale" Type="String" />
<ext:ModelField Name="UtenteAttivo" Type="Boolean" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server" ID="ColumnModelRisultatoRicerca" EnableColumnHide="False">
<Defaults>
<ext:Parameter Name="Cls" Value="AllineamentoIntestazioneColonnaCentro" Mode="Value" />
<ext:Parameter Name="MenuDisabled" Value="true" Mode="Value" />
</Defaults>
<Columns>
<ext:ComponentColumn runat="server" ID="CodiceTipoUtente" Text="Tipo utente" DataIndex="CodiceTipoUtente" Width="130">
<Component>
<ext:Container runat="server" ID="ContainerCodiceTipoUtente" Layout="HBoxLayout" >
<Items>
<ext:Image runat="server" ID="ImageCodiceTipoUtente" Height="20" Width="20" />
<ext:ToolbarSpacer runat="server" ID="ToolbarSpacerCodiceTipoUtente" Width="8" />
<ext:Label runat="server" ID="LabelCodiceTipoUtente" />
</Items>
</ext:Container>
</Component>
<Listeners>
<BeforeBind Handler="e.config[0].items[0].imageUrl = Ext.net.ResourceMgr.resolveUrl(Ext.String.format(' ~/Immagini/{0}.png', e.record.data.CodiceTipoUtente)); e.config[0].items[2].text = e.record.data.CodiceTipoUtente;" />
</Listeners>
</ext:ComponentColumn>
<ext:Column runat="server" ID="CodiceUtente" Text="Codice utente" DataIndex="CodiceUtente" />
<ext:Column runat="server" ID="Cognome" Text="Cognome" DataIndex="Cognome" />
<ext:Column runat="server" ID="Nome" Text="Nome" DataIndex="Nome" />
<ext:Column runat="server" ID="RagioneSociale" Text="Ragione sociale" DataIndex="RagioneSociale" Flex="1"/>
<ext:CheckColumn runat="server" ID="UtenteAttivo" Text="Attivo" DataIndex="UtenteAttivo" MaxWidth="50" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel runat="server" ID="SelectionModelRisultatoRicerca" Mode="Multi" >
<DirectEvents>
<SelectionChange OnEvent="GridPanelRisultato_SelectionChange" />
</DirectEvents>
</ext:RowSelectionModel>
</SelectionModel>
<Plugins>
<ext:FilterHeader runat="server" ID="FilterHeaderRisultatoRicerca" />
</Plugins>
<BottomBar>
<ext:Toolbar runat="server" ID="ToolbarRisultatoRicerca">
<Items>
<ext:Button runat="server" ID="ButtonNuovoUtente" Text="Nuovo" Icon="New" OnDirectClick="ButtonNuovoUtente_Click" />
<ext:Button runat="server" ID="ButtonModificaUtente" Text="Modifica" Icon="ApplicationEdit" OnDirectClick="ButtonModificaUtente_Click" />
<ext:Button runat="server" ID="ButtonEliminaUtente" Text="Elimina" Icon="Delete" OnDirectClick="ButtonEliminaUtente_Click" />
<ext:ToolbarSeparator runat="server" ID="ToolbarSeparator1" />
<ext:Button runat="server" ID="ButtonCambiaPassword" Text="Cambia password" Icon="Key" OnDirectClick="ButtonCambiaPassword_Click" />
<ext:ToolbarSeparator runat="server" ID="ToolbarSeparator2" />
<ext:Button runat="server" ID="ButtonAbilitaUtente" Text="Abilita" Icon="ArrowUp" OnDirectClick="ButtonAbilitaUtente_Click" />
<ext:Button runat="server" ID="ButtonDisabilitaUtente" Text="Blocca" Icon="Stop" OnDirectClick="ButtonDisabilitaUtente_Click" />
</Items>
</ext:Toolbar>
</BottomBar>
</ext:GridPanel>


In attach bitmap with description....http://forums.ext.net/attachment.php?attachmentid=18231&stc=1

Daniil
Jan 06, 2015, 2:10 AM
Hi @Mario,

Please try this setting for the ComponentColumn.

StopSelection="false"

Mario
Jan 06, 2015, 10:08 AM
WOW !

It works!

Tnx Danill, you can close the thread.