Mar 26, 2013, 9:29 AM
getValue problem in js
<ext:XScript ID="XScript1" runat="server">
<script>
var IDVer = function()
{
return #{TfFId}.getValue(); // Uncaught TypeError: Cannot call method 'getValue' of undefined
};
</script>
</ext:XScript>
<ext:TextField ID="TfFId" Text="0" runat="server" Hidden="true" />
<ext:GridPanel ID="GridPanel1" Region="Center" Flex="1" Height="250" runat="server">
<LeftBar>
<ext:Toolbar runat="server">
<Items>
<ext:Button runat="server" Icon="Add" Handler="#{Store1}.insert(0,new ModelStok());"/>
</Items>
</ext:Toolbar>
</LeftBar>
<Store>
<ext:Store ID="Store1" runat="server" OnBeforeStoreChanged="Kaydet">
<Model>
<ext:Model Name="ModelStok" IDProperty="Id" runat="server">
<Fields>
<ext:ModelField Name="Id" Type="Int" />
<ext:ModelField Name="StokId" Type="Int" />
<ext:ModelField Name="StokKodu" Type="String" />
<ext:ModelField Name="StokAdi" Type="String" />
<ext:ModelField Name="Miktar" Type="Int" />
<ext:ModelField Name="Fiyat" Type="Float" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<ext:RowNumbererColumn runat="server" />
<ext:Column runat="server" Text="Stok Kodu" MinWidth="80" DataIndex="StokKodu" />
<ext:Column runat="server" Text="Stok Adı" DataIndex="StokAdi" Width="570">
<Editor>
<ext:ComboBox runat="server" DisplayField="Adi" ValueField="Adi" TypeAhead="false" PageSize="10" HideBaseTrigger="true" MinChars="1">
<ListConfig LoadingText="Aranıyor...">
<ItemTpl ID="ItemTpl1" runat="server">
<Html>
<div class="search-item">
<h3><span>{Fiyati}</span>{Adi}</h3>
{Kodu}
</div>
</Html>
</ItemTpl>
</ListConfig>
<Store>
<ext:Store ID="Store2" runat="server" AutoLoad="false">
<Proxy>
<ext:AjaxProxy Url="HStok.ashx">
<ActionMethods Read="POST" />
<ExtraParams>
<ext:Parameter Name="ID" Value="IDVer()" Mode="Raw" />
</ExtraParams>
<Reader>
<ext:JsonReader Root="plants" TotalProperty="total" />
</Reader>
</ext:AjaxProxy>
</Proxy>
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="Adi" />
<ext:ModelField Name="Kodu" />
<ext:ModelField Name="Fiyati" Type="Float" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
</ext:ComboBox>
</Editor>
</ext:Column>
<ext:Column runat="server" DataIndex="Miktar" Width="60" Text="Miktarı">
<EditorOptions AutoSize="true" />
<Editor>
<ext:NumberField runat="server" AllowBlank="false" MinValue="1" />
</Editor>
</ext:Column>
<ext:Column runat="server" Text="Fiyatı" DataIndex="Fiyat" Width="60" Align="Right" />
</ColumnModel>
<Plugins>
<ext:CellEditing runat="server" ClicksToEdit="1"/>
</Plugins>
</ext:GridPanel>
fifth row, I get the error Uncaught TypeError: Cannot call method 'getValue' of undefined if calling the js function from button error does not.
How send Textfield value parameter to *.ashx file in AjaxProxy.
Thank you.
-Hakan Ertuğ