[CLOSED] Get JSON Store Record from ComboBox on Select

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] Get JSON Store Record from ComboBox on Select

    I'm new to Ext.NET and I'm sure this has a simple solution but I've been googling for hours to no avail. This is what I need: when I select an item in my ComboBox, I want to retrieve the corresponding Store record as a JSON string. I'd prefer to do this in C# (code behind) not JavaScript, unless it's impossible or a js solution is much simpler.

    I set up my Store as follows:
    <ext:Store runat="server" ID="MuseumProjectStore" AutoDataBind="true">
            <Proxy>
                <ext:AjaxProxy Json="true" Url='<%#projectsUrl%>'>
                    <ActionMethods Read="POST" />
                    <Reader>
                        <ext:JsonReader Root="" />
                    </Reader>
                </ext:AjaxProxy>
            </Proxy>
            <Model>
                <ext:Model runat="server">
                    <Fields>
                        <ext:ModelField Name="PROJECT_ID" Type="Int" />
                        <ext:ModelField Name="PROJECT_NAME" Type="String" />
                        <ext:ModelField Name="PROJECT_DESC" Type="String" />
                        <ext:ModelField Name="PROJECT_STATUS_ID" Type="Int" />
                        <ext:ModelField Name="PROJECT_STATUS_DESC" Type="String" />
                        <ext:ModelField Name="REMEDIATION_ID" Type="Int" />
                        <ext:ModelField Name="REMEDIATION_DESC" Type="String" />
                        <ext:ModelField Name="REMEDIATION_DATE" Type="String" />
                        <ext:ModelField Name="CONTACT_ID" Type="Int" />
                        <ext:ModelField Name="CONTACT_DESC" Type="String" />
                        <ext:ModelField Name="SID" Type="String" />
                    </Fields>
                </ext:Model>
            </Model>
        </ext:Store>
    Here is the ComboBox (part of a FormPanel):
    <ext:ComboBox runat="server" ID="ProjectDropDown" FieldLabel="Project" DisplayField="PROJECT_NAME"
                                Editable="false" ValueField="PROJECT_ID" StoreID="MuseumProjectStore">
                                <DirectEvents>
                                    <Select OnEvent="ProjectSelect">
                                        <EventMask ShowMask="true" />
                                    </Select>
                                </DirectEvents>
                            </ext:ComboBox>
    And here is the pathetic Select event handler:
    protected void ProjectSelect(object sender, DirectEventArgs e)
        {
            int selectedIndex = ProjectDropDown.SelectedItem.Index;
            X.Msg.Alert("Alert", selectedIndex).Show();
        }
    I tried accessing the Store record using the selected index but couldn't get it to work. :(

    Thanks!
    Last edited by Baidaly; Jul 11, 2013 at 12:38 AM. Reason: [CLOSED]

Similar Threads

  1. Replies: 11
    Last Post: Jun 06, 2013, 1:14 PM
  2. [CLOSED] Can not select combobox items using store
    By blurken in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: May 21, 2012, 1:20 AM
  3. Can not select combobox items using store
    By blurken in forum 2.x Help
    Replies: 0
    Last Post: May 14, 2012, 1:23 AM
  4. Replies: 2
    Last Post: Jan 02, 2011, 3:06 PM
  5. How to select row by JSon...
    By rebulanyum in forum 1.x Help
    Replies: 0
    Last Post: Mar 03, 2010, 5:29 AM

Tags for this Thread

Posting Permissions