PDA

View Full Version : [CLOSED] [bug] Form validation + <view> tag in gridpanel



bossun
May 23, 2013, 10:23 PM
Hi to every one.

I used this code until today and it worked fine.

I tried to improve my interface by adding a function that sets a conditional background-color for all rows in the gridpanel. For that I followed some examples that I found in you website.

I notice when I added the "<View>" tag to my GridPanel, the isValid() function throws an error you can see below. If I remove this tag, everything works fine.


Uncaught TypeError: Object [object Object] has no method 'isValid' Convocations.aspx:108
Ext.create.items.listeners.validitychange.fn Convocations.aspx:108
fire ext.axd:18
Ext.util.DirectObservable.continueFireEvent ext.axd:25
(anonymous function) ext.axd:18
Ext.util.DirectObservable.fireEventArgs ext.axd:23
Ext.Component.fireEventArgs ext.axd:50
(anonymous function) ext.axd:18
fire ext.axd:18
Ext.util.DirectObservable.continueFireEvent ext.axd:25
(anonymous function) ext.axd:18
Ext.util.DirectObservable.fireEventArgs ext.axd:23
(anonymous function) ext.axd:18
Ext.util.DirectObservable.fireEvent ext.axd:23
(anonymous function) ext.axd:18
Ext.define.checkValidity ext.axd:18
c ext.axd:18

Could it be a bug or did I do something wrong?

Thank you for your help.




<ext:Window runat="server" ID="ConvocationDetails"
Layout="BorderLayout" Hidden="true"
AutoShow="false" Modal="true"
CloseAction="Hide" Height="380" Width="650">
<Items>
<ext:FormPanel runat="server"
Flex="1" Frame="false"
ID="ConvocationEditor"
Region="Center"
BodyPadding="5"
Title="<%$ Resources:Resource,Convocation %>"
DefaultAnchor="95%">
<Items>
<ext:Hidden runat="server" ID="MATCHID" Name="MATCHID"></ext:Hidden>
<ext:ComboBox ID="ComboBox1"
runat="server"
Name="REFEREEID"
StoreID="RefereeStoreID"
ValueField="ID"
DisplayField="FULLNAME"
AllowBlank="false"
MsgTarget="Side"
FieldLabel="<%$ Resources:Resource,Referee %>"
TypeAhead="true"
QueryMode="Local"
>
<ListConfig ID="ListConfig1" runat="server">
<ItemTpl ID="ItemTpl1" runat="server">
<Html>
<tpl for=".">
<div class="list-item" id="{ID}">
<div style="float:left; width:17px;height:17px;">
<tpl if="ON_THE_SPOT!=''">
<img src="../Resources/system/hockey-icon.png" height="17" width="17"></img>
</tpl>
</div>
<div style="float:left; width:17px;height:17px; margin-right:2px; margin-left:2px">
<tpl if="IS_BUSY!=''">
<img src="../icons/status_busy-png/ext.axd" height="17" width="17"></img>
</tpl>
</div>
<div><h3>{FULLNAME}</h3></div>
<div class="Warn">{REFERENCE_CLUB}</div>
</div>
</tpl>
</Html>
</ItemTpl>
</ListConfig>
</ext:ComboBox>
<ext:ComboBox ID="CBrefereetype" runat="server"
Name="REFEREETYPE"
StoreID="RefereeTypeStoreID"
ValueField="KEY"
DisplayField="TRANSLATEDVALUE"
FieldLabel="<%$ Resources:Resource,RefereeType %>"
AllowBlank="false"
MsgTarget="Side"
></ext:ComboBox>
<ext:TextArea ID="TextArea1" runat="server" Name="COMMENT" FieldLabel="<%$ Resources:Resource,Comment %>" Height="50">
</ext:TextArea>

</Items>
<Listeners>
<ValidityChange Handler="#{btnSaveConvocation}.setDisabled(!#{ConvocationEd itor}.isValid());" />
</Listeners>
<TopBar>
<ext:Toolbar ID="Toolbar1" runat="server">
<Items>
<ext:Button runat="server" ID="btnSaveConvocation" Icon="Disk" Text="<%$ Resources:Resource,Save %>" Disabled="true">
<DirectEvents>
<Click OnEvent="btnSaveConvocation_Click">
<ExtraParams>
<ext:Parameter Name="ConvocationRecord" Mode="Raw" Encode="true" Value="#{ConvocationEditor}.getForm().getValues()" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
</ext:FormPanel>
<ext:GridPanel
ID="ConvenedRefereesGridPanel"
runat="server" Flex="1"
StoreID="ConvocationStoreID"
Region="South" Title="<%$ Resources:Resource,ConvenedReferees %>"
Split="true">
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:CommandColumn runat="server" Width="25">
<Commands>
<ext:GridCommand Icon="Delete" ToolTip-Text="<%$ Resources:Resource,Delete %>" CommandName="Delete" StandOut="true"/>
</Commands>
<DirectEvents>
<Command OnEvent="ConvocationDelete">
<Confirmation ConfirmRequest="true" Message="<%$ Resources:Messages,M_Confirm_Delete %>" Title="<%$ Resources:Resource,DeleteConfirmation %>" />
<EventMask Target="CustomTarget" CustomTarget="#{ConvocationDetails}" ShowMask="true" Msg="<%$ Resources:Messages,M_Wait_Delete %>" />
<ExtraParams>
<ext:Parameter Name="ID" Value="record.data.ID" Mode="Raw" />
<ext:Parameter Name="MATCHID" Value="record.data.MATCHID" Mode="Raw" />
</ExtraParams>
</Command>
</DirectEvents>
</ext:CommandColumn>
<ext:Column ID="Column1" runat="server" DataIndex="REFEREEID" Text="<%$ Resources:Resource,Referees %>" Flex="1">
<Renderer Fn="UserRenderer" />
</ext:Column>
<ext:Column ID="Column7" runat="server" DataIndex="REFEREETYPE" Text="<%$ Resources:Resource,RefereeType %>" Flex="1">
<Renderer Fn="RefereeTypeRenderer" />
</ext:Column>
<ext:Column ID="Column2" runat="server" DataIndex="REFEREESTATUS" Text="<%$ Resources:Resource,RefereeStatus %>" Flex="1">
<Renderer Fn="RefereeStatusRenderer" />
</ext:Column>
<ext:Column ID="Column3" runat="server" DataIndex="CONVOCATORSTATUS" Text="<%$ Resources:Resource,ConvocatorStatus %>" Flex="1">
<Renderer Fn="ConvocatorStatusRenderer" />
</ext:Column>
<ext:Column ID="Column4" runat="server" DataIndex="CONVOCATIONTYPEID" Text="<%$ Resources:Resource,ConvocationType %>" Flex="1">
<Renderer Fn="ConvocationTypeRenderer" />
</ext:Column>
<ext:Column ID="Column5" runat="server" DataIndex="COMMENT" Text="<%$ Resources:Resource,Comment %>" Flex="1"></ext:Column>
<ext:Column ID="Column6" runat="server" DataIndex="CONVOCATORID" Text="<%$ Resources:Resource,Convocator %>" Flex="1">
<Renderer Fn="UserRenderer" />
</ext:Column>
</Columns>
</ColumnModel>
<View>
<ext:GridView runat="server" >
<GetRowClass Fn="ConvocationRowFormat"></GetRowClass>
</ext:GridView>
</View>
</ext:GridPanel>
</Items>
<DirectEvents>
<Close OnEvent="ConvocationDetails_Close" />
</DirectEvents>
</ext:Window>

Vladimir
May 23, 2013, 10:44 PM
Please provide runable test case

bossun
May 28, 2013, 6:31 AM
Please forget about it. There is no bug.

It was a mistake in my CSS class.

Thank you