PDA

View Full Version : [CLOSED] SVN update. getCount error in javascript



CarWise
Mar 06, 2014, 2:11 PM
Hi,

When running following code which uses listfilters with store (no need to add data in the grids, because the issue occured also with grid filling) there is a javascript error: Uncaught TypeError: Object strStatus has no method 'getCount'

When commenting the status store...the next store (strSoort) gives the same error..



<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title>test</title>
<link href="/resources/css/examples.css" rel="stylesheet" />
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:Store ID="strStatus" runat="server">
<Model>
<ext:Model ID="smStatus" runat="server" IDProperty="ID">
<Fields>
<ext:ModelField Name="cStatus" Mapping="cStatus" />
<ext:ModelField Name="ID" Mapping="ID" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
<ext:Store ID="strSoort" runat="server">
<Model>
<ext:Model ID="smSoort" runat="server" IDProperty="ID">
<Fields>
<ext:ModelField Name="cSoort" Mapping="cSoort" />
<ext:ModelField Name="ID" Mapping="ID" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
<ext:Store ID="strMedewerker" runat="server">
<Model>
<ext:Model ID="mdlMedewerker" runat="server" IDProperty="ID">
<Fields>
<ext:ModelField Name="cNaam" Mapping="cNaam" />
<ext:ModelField Name="ID" Mapping="ID" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
<ext:Viewport ID="Viewport1" runat="server" Layout="BorderLayout" Stateful="true">
<Items>
<ext:Panel ID="pnlIssues" runat="server" Region="Center" Frame="true" Header="True" Title="Meldingen" Icon="Bug" Layout="Fit" MarginsSummary="0 5 0 5">
<Items>
<ext:GridPanel Stateful="true" ID="gpIssues" runat="server" StateID="siIssues" InvalidateScrollerOnRefresh="false">
<Store>
<ext:Store ID="strIssues" runat="server" PageSize="200">
<Model>
<ext:Model ID="smIssues" runat="server" IDProperty="ID">
<Fields>
<ext:ModelField Name="ID"/>
<ext:ModelField Name="cNummer" />
<ext:ModelField Name="cStatus" SortType="AsUCString"/>
<ext:ModelField Name="nStatusID" />
<ext:ModelField Name="cGroep" SortType="AsUCString"/>
<ext:ModelField Name="nKlantID" Type="String" />
<ext:ModelField Name="nOpNaamVanID" />
<ext:ModelField Name="cTitel" SortType="AsUCString"/>
<ext:ModelField Name="nDatumAanmaak" />
<ext:ModelField Name="nTijdAanmaak" Type="String" />
<ext:ModelField Name="nDatumMutatie" />
<ext:ModelField Name="nTijdMutatie" Type="String" />
<ext:ModelField Name="cNaamContact" SortType="AsUCString"/>
<ext:ModelField Name="cPakket" SortType="AsUCString"/>
<ext:ModelField Name="cBuildNummer" SortType="AsUCString"/>
<ext:ModelField Name="cBuildNummerCurrent" SortType="AsUCString" />
<ext:ModelField Name="cClusterNaam" SortType="AsUCString"/>
<ext:ModelField Name="cTags" SortType="AsUCString"/>
<ext:ModelField Name="bIsNieuw" />
<ext:ModelField Name="nAantal" />
<ext:ModelField Name="cKlantAlles" SortType="AsUCString" />
<ext:ModelField Name="cNaamContact" SortType="AsUCString"/>
<ext:ModelField Name="cTelefoonContact" />
<ext:ModelField Name="cEmailContact" SortType="AsUCString"/>
<ext:ModelField Name="nOpNaamVanID" />
<ext:ModelField Name="cPrioriteit" SortType="AsUCString"/>
<ext:ModelField Name="cReferentieKlant" SortType="AsUCString"/>
<ext:ModelField Name="cIssueGroep" SortType="AsUCString"/>
<ext:ModelField Name="cSoort" SortType="AsUCString"/>
<ext:ModelField Name="bResponseKlant" />
<ext:ModelField Name="bTeLezenKlant"/>
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="cmIssues" runat="server">
<Columns>
<ext:ImageCommandColumn ID="iccEdit" runat="server" Width="25" Align="Center">
<Commands>
<ext:ImageCommand CommandName="Aanpassen" Icon="ApplicationEdit" ToolTip-Text="Aanpassen" />
</Commands>
</ext:ImageCommandColumn>
<ext:ImageCommandColumn ID="iccAttachements" runat="server" Width="25" Align="Center">
<Commands>
<ext:ImageCommand CommandName="Files" Icon="Attach" ToolTip-Text="Files" />
</Commands>
</ext:ImageCommandColumn>
<ext:ImageCommandColumn ID="iccGekoppeld" runat="server" Width="25" Align="Center">
<Commands>
<ext:ImageCommand CommandName="Gekoppeld" Icon="Key" ToolTip-Text="Gekoppelde meldingen" />
</Commands>
</ext:ImageCommandColumn>
<ext:Column ID="clID" runat="server" Align="right" DataIndex="cNummer" Text="Nummer" Width="55" />
<ext:Column ID="clStatus" runat="server" DataIndex="cStatus" Text="Status" />
<ext:Column ID="clSoort" runat="server" DataIndex="cSoort" Text="Soort" />
<ext:Column ID="clGroep" runat="server" DataIndex="cGroep" Text="Afdeling" Hidden="true" />
<ext:Column ID="clTitel" runat="server" DataIndex="cTitel" Text="Titel" Width="300" />
<ext:Column ID="clOpNaam" runat="server" Text="Op naam" DataIndex="nOpNaamVanID" Width="150">
<Editor>
<ext:ComboBox ID="ComboBox1" runat="server" EmptyText="-- Kies collega --"
DisplayField="cNaam" ValueField="ID" TriggerAction="All"
QueryMode="Local" StoreID="strMedewerker">
<Triggers>
<ext:FieldTrigger Icon="Clear" HideTrigger="true" />
</Triggers>
</ext:ComboBox>
</Editor>
</ext:Column>
<ext:Column ID="clKlantID" Align="right" runat="server" DataIndex="nKlantID" Text="Klantnr." Width="50" Hidden="true" />
<ext:Column ID="clKlant" Align="left" runat="server" DataIndex="cKlantAlles" Text="Klant" Width="150" />
<ext:Column ID="clNaamContact" runat="server" DataIndex="cNaamContact" Text="Naam contact" Width="120" />
<ext:Column ID="clTelefoon" Align="left" runat="server" DataIndex="cTelefoonContact" Text="Telefoon" Width="100" />
<ext:Column ID="clEmail" Align="left" runat="server" DataIndex="cEmailContact" Text="Email" Width="100" />
<ext:Column ID="clPakket" runat="server" DataIndex="cPakket" Text="Pakket" />
<ext:Column ID="clTags" runat="server" DataIndex="cTags" Text="Tags" />
<ext:Column ID="clBuildNummer" runat="server" DataIndex="cBuildNummer" Text="Buildnummer" />
<ext:Column ID="clBuildNummerCurrent" runat="server" DataIndex="cBuildNummerCurrent" Text="Actueel Bldnr." />
<ext:Column ID="clnDatumAanmaak" Align="right" runat="server" DataIndex="nDatumAanmaak" Text="Datum" Width="80">
</ext:Column>
<ext:Column ID="clnTijd" Align="right" runat="server" DataIndex="nTijdAanmaak" Text="Tijd" Width="60">
</ext:Column>
<ext:Column ID="clnDatumMutatie" Align="right" runat="server" DataIndex="nDatumMutatie" Text="Datum Mutatie" Width="80">
</ext:Column>
<ext:Column ID="clnTijdMutatie" Align="right" runat="server" DataIndex="nTijdMutatie" Text="Tijd Mutatie" Width="60">
</ext:Column>
<ext:Column ID="clCluster" runat="server" DataIndex="cClusterNaam" Text="Cluster" />
<ext:Column ID="clPrioriteit" runat="server" DataIndex="cPrioriteit" Text="Prioriteit" />
<ext:Column ID="clReferentieKlant" runat="server" DataIndex="cReferentieKlant" Text="Referentie klant" Width="120" />
<ext:Column ID="clIssueGroep" runat="server" DataIndex="cIssueGroep" Text="Meldinggroep" Width="120" />
</Columns>
</ColumnModel>
<Features>
<ext:GridFilters runat="server" ID="gfIssues" Local="true">
<Filters>
<ext:StringFilter DataIndex="cNummer">
</ext:StringFilter>
<ext:ListFilter DataIndex="cStatus" StoreID="strStatus" LabelField="cStatus" IDField="cStatus">
</ext:ListFilter>
<ext:ListFilter DataIndex="cSoort" StoreID="strSoort" LabelField="cSoort" IDField="cSoort">
</ext:ListFilter>
<ext:StringFilter DataIndex="cGroep">
</ext:StringFilter>
<ext:StringFilter DataIndex="cTitel">
</ext:StringFilter>
<ext:NumericFilter DataIndex="nKlantID">
</ext:NumericFilter>
<ext:StringFilter DataIndex="cKlantAlles">
</ext:StringFilter>
<ext:StringFilter DataIndex="cNaamContact">
</ext:StringFilter>
<ext:StringFilter DataIndex="cTelefoonContact">
</ext:StringFilter>
<ext:StringFilter DataIndex="cEmailContact">
</ext:StringFilter>
<ext:StringFilter DataIndex="cPakket">
</ext:StringFilter>
<ext:StringFilter DataIndex="cTags">
</ext:StringFilter>
<ext:StringFilter DataIndex="cBuildNummer">
</ext:StringFilter>
<ext:StringFilter DataIndex="cBuildNummerCurrent">
</ext:StringFilter>
<ext:DateFilter DataIndex="nDatumAanmaak" AutoDataBind="true">
</ext:DateFilter>
<ext:StringFilter DataIndex="nTijdAanmaak" AutoDataBind="true">
</ext:StringFilter>
<ext:StringFilter DataIndex="cClusterNaam" AutoDataBind="true">
</ext:StringFilter>
<ext:StringFilter DataIndex="cPrioriteit" AutoDataBind="true">
</ext:StringFilter>
<ext:StringFilter DataIndex="cReferentieKlant" AutoDataBind="true">
</ext:StringFilter>
<ext:StringFilter DataIndex="nOpNaamVanID" AutoDataBind="true">
</ext:StringFilter>
<ext:StringFilter DataIndex="cIssueGroep" AutoDataBind="true">
</ext:StringFilter>
</Filters>
<Listeners>
</Listeners>
</ext:GridFilters>
</Features>
<SelectionModel>
<ext:RowSelectionModel ID="rsmIssues" runat="server" Mode="Single">
</ext:RowSelectionModel>
</SelectionModel>
<BottomBar>
<ext:PagingToolbar ID="ptb" runat="server" DisplayMsg="Tonen meldingen {0} - {1} van {2}"
EmptyMsg="Er zijn geen meldingen weer te geven" RefreshText="Ververs">
</ext:PagingToolbar>
</BottomBar>
<TopBar>
<ext:Toolbar ID="Toolbar1" runat="server">
<Items>
<ext:Button ID="btnUpdate" Icon="TransmitRed" Hidden="true" runat="server">
</ext:Button>
<ext:Button ID="btnNew" Icon="ApplicationFormAdd" runat="server" Text="Toevoegen">
</ext:Button>
<ext:Button ID="btnIssues" runat="server" Text="Filter" Icon="BugMagnify">
<Menu>
<ext:Menu ID="mnuIssues" Visible="true" runat="server">
<Items>
<ext:MenuItem ID="mnuNieuw" runat="server" Icon="BugGo" Text="Nieuwe meldingen">
</ext:MenuItem>
<ext:MenuItem ID="mnuOpen" runat="server" Icon="BugGo" Text="Open meldingen">
</ext:MenuItem>
<ext:MenuItem ID="mnuGesloten" runat="server" Icon="BugFix" Text="Afgehandelde meldingen">
</ext:MenuItem>
<ext:MenuItem ID="MenuGekoppeld" runat="server" Icon="BugAdd" Text="Gekoppelde meldingen">
</ext:MenuItem>
<ext:MenuItem ID="MenuAll" runat="server" Icon="BugMagnify" Text="Alle meldingen">
</ext:MenuItem>
<ext:MenuItem ID="MenuVerwijderd" runat="server" Icon="BugDelete" Text="Verwijderde meldingen">
</ext:MenuItem>
</Items>
</ext:Menu>
</Menu>
</ext:Button>
<ext:Button ID="btnExcel" runat="server" Text="Excel export" Icon="PageExcel">
</ext:Button>
<ext:Button ID="btnLicentie" runat="server" Text="Licentie klant" Icon="ChartOrganisation">
</ext:Button>
<ext:ToolbarFill ID="ToolbarFill1" runat="server" />
<ext:Button StandOut="true" ID="btnClearFilter" runat="server" Text="Verwijder filters" Icon="ControlRemoveBlue">
</ext:Button>
<ext:ToolbarSpacer runat="server" />
<ext:Button StandOut="true" ID="btnResetLayout" runat="server" Text="Herstel layout" Icon="Reload">
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<View>
<ext:GridView ID="gvIssues" runat="server" StripeRows="true">
</ext:GridView>
</View>
<Listeners>
<%--<BeforeStateRestore Handler="delete state.filters;" />--%>
<CellDblClick Handler="if (item.headerCt.items.getAt(cellIndex).dataIndex != 'nOpNaamVanID') loadEditWindow(record.data.ID)" />
</Listeners>
<Plugins>
<ext:CellEditing ID="CellEditing1" runat="server" ClicksToEdit="1">
</ext:CellEditing>
</Plugins>
</ext:GridPanel>
</Items>
</ext:Panel>
<ext:Panel ID="pnlSouth" runat="server" Region="South" Title="Details" Height="250"
Icon="BugMagnify" Layout="Fit" Collapsible="true" Split="true" MarginsSummary="0 5 5 5">
<Items>
<ext:GridPanel ID="gpIssueRows" runat="server" Border="false" Stateful="true" StateID="siIssueRows">
<Store>
<ext:Store ID="strIssueRows" runat="server" AutoLoad="false">
<Model>
<ext:Model ID="smIssueRows" runat="server" IDProperty="ID">
<Fields>
<ext:ModelField Name="nNummer" Type="Int" />
<ext:ModelField Name="nRegelNummer" Type="Int" />
<ext:ModelField Name="ID" Type="Int" />
<ext:ModelField Name="nissueid" Type="Int" />
<ext:ModelField Name="cIssueNummer" Type="String" />
<ext:ModelField Name="cIssueRegelNummer" Type="String" />
<ext:ModelField Name="cOpmerking" Type="String" HtmlEncode="true" SortType="AsUCString"/>
<ext:ModelField Name="cContactSoort" Type="String" SortType="AsUCString"/>
<ext:ModelField Name="nDatumAanmaak" Type="Int" />
<ext:ModelField Name="nTijdAanmaak" Type="Int" />
<ext:ModelField Name="cNaamDoor" Type="String" SortType="AsUCString"/>
<ext:ModelField Name="cNaamVraagAan" Type="String" SortType="AsUCString"/>
<ext:ModelField Name="bIsRetrieved" Type="Boolean" />
<ext:ModelField Name="nGebruikerVraagAanID" Type="Int" />
<ext:ModelField Name="bIsGesteldeVraag" Type="Boolean" />
<ext:ModelField Name="bIsIntern" Type="Boolean" />
<ext:ModelField Name="bResponseKlant" Type="Boolean" />
<ext:ModelField Name="bIsHistorisch" Type="Boolean" />
</Fields>
</ext:Model>
</Model>
<Reader>
<ext:JsonReader IDProperty="ID" />
</Reader>
</ext:Store>
</Store>
<ColumnModel ID="cmIssueRows" runat="server">
<Columns>
<ext:Column ID="clRegelNummber" runat="server" DataIndex="nRegelNummer" Text="Regelnummer" Width="70" />
<ext:Column ID="clnNummer" runat="server" DataIndex="nNummer" Visible="false" />
<ext:Column ID="clIssueNummer" runat="server" DataIndex="cIssueNummer" Text="Issue nummer"
Visible="false" />
<ext:Column ID="clIssueRegelNummer" runat="server" DataIndex="cIssueRegelNummer"
Text="Regelnummer" Width="100" Visible="false" />
<ext:ImageCommandColumn ID="iccAttach" runat="server" Width="25" Align="Center">
</ext:ImageCommandColumn>
<ext:CheckColumn Editable="false" ID="clIsIntern" runat="server" DataIndex="bIsIntern" Text="Intern" Width="50" />
<ext:Column Flex="1" ID="clOpmerkingIR" runat="server" DataIndex="cOpmerking" Text="Opmerking" />
<ext:Column ID="clContactSoortIR" runat="server" DataIndex="cContactSoort" Text="Contactsoort" />
<ext:Column ID="clDatumAanmaakIR" runat="server" DataIndex="nDatumAanmaak" Text="Aanmaakdatum">
</ext:Column>
<ext:Column ID="clTijdAanmaakIR" runat="server" DataIndex="nTijdAanmaak" Text="Aanmaaktijd">
</ext:Column>
<ext:Column ID="clNaamDoorIR" runat="server" DataIndex="cNaamDoor" Text="Naam door" />
<ext:Column ID="clNaamVraagAanIR" runat="server" DataIndex="cNaamVraagAan" Text="Naam vraag aan" />


</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="rsmIssueRows" runat="server" Mode="Single" />
</SelectionModel>
<TopBar>
<ext:Toolbar ID="tbRows" runat="server">
<Items>
<ext:Button ID="btnAddRow" Icon="ApplicationFormAdd" runat="server" Text="Toevoegen">
</ext:Button>
<ext:Button ID="Button1" runat="server" Text="Excel export" Icon="PageExcel">
</ext:Button>
<ext:ToolbarSeparator ID="tbsDeleted" runat="server" Hidden="true" />
<ext:Checkbox ID="chbDeleted" runat="server" LabelWidth="120" FieldLabel="Toon verwijderde regels" BoxLabelAlign="Before" Hidden="true" LabelAlign="left">
</ext:Checkbox>
</Items>
</ext:Toolbar>
</TopBar>
<View>
<ext:GridView ID="gvIssueRows" runat="server" StripeRows="true">
</ext:GridView>
</View>
<BottomBar>
<ext:PagingToolbar ID="ptRows" runat="server" HideRefresh="true" />
</BottomBar>
<Listeners>
<CellDblClick/>
</Listeners>
<Features>
<ext:GridFilters runat="server" ID="gfIssueRows" Local="true">
<Filters>
<ext:NumericFilter DataIndex="nRegelNummer">
</ext:NumericFilter>
<ext:StringFilter DataIndex="cIssueRegelNummer">
</ext:StringFilter>
<ext:BooleanFilter DataIndex="bIsIntern" NoText="Nee" YesText="Ja">
</ext:BooleanFilter>
<ext:StringFilter DataIndex="cOpmerking">
</ext:StringFilter>
<ext:StringFilter DataIndex="cContactSoort">
</ext:StringFilter>
<ext:DateFilter DataIndex="nDatumAanmaak" AutoDataBind="true">
<DatePickerOptions runat="server" Format="dd-MM-yyyy" TodayText="Vandaag" />
</ext:DateFilter>
<ext:StringFilter DataIndex="nTijdAanmaak" AutoDataBind="true">
</ext:StringFilter>
<ext:StringFilter DataIndex="cNaamDoor">
</ext:StringFilter>
<ext:StringFilter DataIndex="cNaamVraagAan">
</ext:StringFilter>
</Filters>
</ext:GridFilters>
</Features>
</ext:GridPanel>
</Items>
<Listeners>
<Expand Handler="#{strIssueRows}.reload();" />
</Listeners>
</ext:Panel>


</Items>
</ext:Viewport>
</form>
</body>
</html>




Martin

Vladimir
Mar 06, 2014, 3:01 PM
Please use the following fix


Ext.ux.grid.menu.ListMenu.override({
constructor: function (cfg) {
if (cfg && cfg.store) {
cfg.store = Ext.data.StoreManager.lookup(cfg.store);
}
this.callParent([cfg]);
}
});

CarWise
Mar 07, 2014, 10:57 AM
Thanks,

Works. Mark als Closed,

Is this a temporary workaround or will you update in SVN ?

Martin

Daniil
Mar 07, 2014, 12:05 PM
It has been committed to the trunk in the revision #5713.

CarWise
Nov 14, 2014, 8:52 AM
Hi guys...

broken again (Updated SVN) :\

"Uncaught TypeError: Cannot read property 'getCount' of undefined "

The 'workaround doesn't do the trick also.. No error but 'empty' list ... (see screenshot)

Martin

Daniil
Nov 14, 2014, 9:09 AM
Hi Martin,

I am running the test case from the original post. It doesn't produce an error for me. Maybe, because there is no data.

Could you, please, provide a test case to reproduce?

CarWise
Nov 14, 2014, 9:47 AM
Found the issue. In comparing with the code above. I have my stores inside the combobox like this:




<ext:ComboBox
ID="ComboBox1"
runat="server"
Editable="false"
AllowBlank="false"
ValueField="nId"
DisplayField="Soort"
EmptyText="-- Kies inzetsoort --"
ForceSelection="true"
Mode="Local"
TriggerAction="All">
<Store>
<ext:Store
runat="server"
ID="Store1">
<Model>
<ext:Model runat="server" ID="Model1" IDProperty="nId">
<Fields>
<ext:ModelField Name="nId" Type="Int" />
<ext:ModelField Name="Soort" Type="String" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
</ext:ComboBox>

<ext:ListFilter DataIndex="nRentSoortID" StoreID="Store1" LabelField="Soort" IDField="nId"/>



]When placing the store 'outside' the combo and using a storeID the problem vanished.

Regards,

Martin

Daniil
Nov 15, 2014, 7:19 AM
Please try to set AutoDestroy="false" for the Store and still have it inside the ComboBox's Store.

It might be related to the item #3 of the breaking changes in the release v2.5.0.
http://examples2.ext.net/#/Getting_Started/Release_Documents/BREAKING_CHANGES/

CarWise
Nov 17, 2014, 11:06 AM
Didn't solve the problem Daniil.

I removed all the stores form the combos and don't have the problem anymore so I can move on. But it still exist.

Will send you some testcode later.

Martin