SelectBox and JSON reader -- SelectBox only shows "Loading...."

  1. #1

    SelectBox and JSON reader -- SelectBox only shows "Loading...."

    in my form I have a SelectBox, which should load the data from the server.
    When I click on the "down" arrow of the SelectBox, it only displays "loading..." and no content is shown.

    here is my SelectBox:
    <ext:SelectBox ID="ContractGroup" runat="server" DisplayField="ContractGroupName"
                ValueField="ContractGroupID" EmptyText="ContractGroup...">
                <Store>
                    <ext:Store ID="Store_ContractGroup" runat="server">
                        <Model>
                            <ext:Model ID="Model1" runat="server">
                                <Fields>
                                    <ext:ModelField Name="ContractGroupID" />
                                    <ext:ModelField Name="ContractGroupName" />
                                </Fields>
                                <Proxy>
                                    <ext:JsonPProxy Url="/Contract/GetContractGroup">
                                        <Reader>
                                            <ext:JsonReader AutoDataBind="true">
                                            </ext:JsonReader>
                                        </Reader>
                                    </ext:JsonPProxy>
                                </Proxy>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
            </ext:SelectBox>
    and here is the json response form the server:
    [{"ContractGroupID":1,"ContractGroupName":"root"},{ "ContractGroupID":2,"ContractGroupName":"MasterGro up"}]
    I did search the web already for an example, where I could see what I am doing wrong, but I could not find anything.
  2. #2
    I solved it by changing the JsonPProxy to AjaxProxy

    thanks
    Gerald


    Quote Originally Posted by geraldf View Post
    in my form I have a SelectBox, which should load the data from the server.
    When I click on the "down" arrow of the SelectBox, it only displays "loading..." and no content is shown.

    here is my SelectBox:
                                <Proxy>
                                    <ext:JsonPProxy Url="/Contract/GetContractGroup">
                                        <Reader>
                                            <ext:JsonReader AutoDataBind="true">
                                            </ext:JsonReader>
                                        </Reader>
                                    </ext:JsonPProxy>
                                </Proxy>

Similar Threads

  1. Replies: 6
    Last Post: Jul 03, 2012, 5:46 PM
  2. [CLOSED] SelectBox: Problem with characters "<" and ">"
    By nhg_itd in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 03, 2011, 6:43 AM
  3. Replies: 4
    Last Post: Oct 24, 2011, 3:34 AM
  4. Replies: 4
    Last Post: Oct 11, 2011, 2:42 AM
  5. Replies: 1
    Last Post: Mar 13, 2011, 9:21 AM

Posting Permissions