View Full Version : [CLOSED] can't bind to texfield on page with GridPanel & FormPanel & two stores

Jun 04, 2014, 7:45 PM
UPDATE --- Please close.. found the error Handler="var record = this.getAt(0) || {};#{FormPanel1}.getForm().loadRecord(record);" is pointing to the wrong form panel. Needed to be fPanel6.. ugh

Hey there, I've got a Gridpanel bound to a store whose source is a SqlDatasource.. That works fine. no problem. I then add a Formpanel with another store that's bound to a different sqlDatasource.. but I can't get the textfields to bind. All the stored procedures fire, and they return data.. I just can't seem to get date into the textfields.

I'm kinda new, so I'm sure there's some simple mistake somewhere... maybe with the loading of the formpanel or those htmlbin tags... Code is below.. Thanks.

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Proj_MS.aspx.vb" Inherits="MSEFUSION.Proj_MS" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Threading" %>


<ext:ResourceManager ID="ResourceManager1" runat="server"></ext:ResourceManager>
<ext:Viewport ID="Viewport1" runat="server" Layout="ColumnLayout" Height="930" >
<ext:GridPanel ID="GridPanel2" runat="server" Height="300" ColumnWidth="1.00" >
<asp:SqlDataSource ID="SQLDS1" runat="server" ConnectionString="<%$ ConnectionStrings:MSE_FIN %>" SelectCommand="PROC_GET_PROJ_MS" SelectCommandType="StoredProcedure">
<asp:Parameter Name="FY" Type="Int32" DefaultValue="2011" />
<ext:Store ID="Store1" runat="server" DataSourceID="SQLDS1" >
<ext:Model ID="Model1" runat="server" IDProperty="ID">
<ext:ModelField Name="DATE" Type="date" />
<ext:ModelField Name="FISCAL YEAR" />
<ext:ModelField Name="ACCNT CODE" />
<ext:ModelField Name="PO" />
<ext:ModelField Name="VENDOR NAME" />
<ext:ModelField Name="POSTED" />
<ext:ModelField Name="ENCUM" />
<ext:ModelField Name="UNENCUM" />
<ext:ModelField Name="PAID_DATE" Type="Date" />
<ext:ModelField Name="EXP_AMNT" Type="Float" />
<ext:ModelField Name="POST_EXP" />
<ext:ModelField Name="EXP_ID" />
<ext:ModelField Name="NAME" />
<ext:ModelField Name="PROJ_ID" />
<ext:ModelField Name="LEDG_POST7" />
<ext:ModelField Name="MOVE_DATE" Type="date" />
<ext:ModelField Name="TRANSFERED TO" />
<ext:ModelField Name="TRANS AMOUNT" Type="Float" />
<ext:ModelField Name="POST_TRANS" />
<ext:ModelField Name="TRAV_DATE" Type="date" />
<ext:ModelField Name="ORDERED BY" />
<ext:ModelField Name="PURPOSE" />
<ext:ModelField Name="VENDOR" />
<ext:ModelField Name="REQNUM" />
<ext:ModelField Name="CPCECTNUM" />
<ext:ModelField Name="TRANSTAT" />


<ColumnModel ID="ColumnModel1" runat="server">
<ext:DateColumn ID="C1" runat="server" DataIndex="DATE" Text="DATE" Width="85" Format="m-dd-yyyy" />
<ext:Column ID="C2" runat="server" DataIndex="FISCAL YEAR" Text="FY" Width="43" />
<ext:Column ID="Column1" runat="server" DataIndex="ACCNT CODE" Text="ACODE" Width="55" />
<ext:Column ID="C4" runat="server" DataIndex="PO" Text="PO" Width="85" />
<ext:Column ID="C5" runat="server" DataIndex="POSTED" Text="POSTED" Width="47" />
<ext:Column ID="C6" runat="server" DataIndex="VENDOR2" Text="VENDOR" Width="160" />
<ext:Column ID="C7" Text="ENCUM" runat="server" Width="75" DataIndex="ENCUM">
<Renderer Format="UsMoney" />
<ext:Column ID="C8" runat="server" DataIndex="UNENCUM" Text="UNENCUM" Width="75" >
<Renderer Format="UsMoney" />
<ext:DateColumn ID="DateColumn1" runat="server" DataIndex="PAID_DATE" Text="PAID_DATE" Width="70" Format="m-dd-yyyy" />
<ext:Column ID="C10" runat="server" DataIndex="EXP_AMNT" Text="EXP AMNT" Width="77" >
<Renderer Format="UsMoney" />
<ext:Column ID="C11" runat="server" DataIndex="POST_EXP" Text="POST EXP" Width="55" />
<ext:Column ID="C21" runat="server" DataIndex="ORDERED BY" Text="ORDERED BY" Width="100" />
<ext:Column ID="C22" runat="server" DataIndex="PURPOSE" Text="PURPOSE" Width="220" />

<ext:formPanel ID="fPanel6" runat="server" ColumnWidth="0.1666" Height="120" BodyPadding="10" BodyStyle="background-color:#ccc" >

<Items >
<ext:TextField ID="TextField12" runat="server" LabelWidth="75" AnchorHorizontal="95%" FieldLabel="C/S" Name="SUM_ENC" Cls="FltLeft"></ext:TextField>
<ext:TextField ID="TextField13" runat="server" LabelWidth="75" AnchorHorizontal="95%" FieldLabel="C/S MET" Name="SUM_EXP" Cls="FltLeft"></ext:TextField>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MSE_FIN %>" SelectCommand="PROC_GET_EXP_TOTS" SelectCommandType="StoredProcedure">
<asp:Parameter Name="PRJNUM" Type="Int32" DefaultValue="440" />
<asp:Parameter Name="FY" Type="String" DefaultValue="2012" />
<asp:Parameter Name="EXPTYPE" Type="Int32" DefaultValue="5" />
<ext:Store ID="Store5" runat="server" PageSize="1" DataSourceID="SqlDataSource1" AutoLoad="true" AutoDataBind="true">
<ext:Model ID="Model5" runat="server" IDProperty="ID">
<ext:ModelField Name="SUM_ENC" Type="Float" />
<ext:ModelField Name="SUM_EXP" Type="Float" />
Handler="var record = this.getAt(0) || {};#{FormPanel1}.getForm().loadRecord(record);"



Jun 05, 2014, 5:51 AM
Hi @megatechboy,

Welcome to the Ext.NET forums!

It is nice that you found a solution. By the way, it might be better to post a solution as a separate post. This way it will be easier to distinguish where a question and answer are. It is just a recommendation for the future.