[CLOSED] Problem about dynamic loading data from server and binding with SelectBox

  1. #1

    [CLOSED] Problem about dynamic loading data from server and binding with SelectBox

    Hi:

    I have a problem about binding SelectBox with store which is dynamic loading data from server
    Basically I don't want store to load the data at the page load. I just want to click a button and then load the data and bind to SelectBox

    The SelectBox details is :
    <ext:SelectBox ID="SelTransferTeam" runat="server" Width="300" 
                                DisplayField="Name" ValueField="Id" EmptyText="<%$Resources:Strings,PleaseSelectATeam%>">
                                <Store>
                                    <ext:Store ID="StoreWorkgroupForCoreTask" runat="server" AutoLoad="false" ShowWarningOnFailure="false">
                                        <Proxy>
                                            <ext:HttpProxy Url="~/Planning/CorePlanning/WorkgroupForCoretask">
                                            </ext:HttpProxy>
                                        </Proxy>
                                        <Listeners>
                                            <LoadException Handler="handleDateRangesException(response)" />
                                        </Listeners>
                                        <BaseParams>
                                            <ext:Parameter Name="coreTaskId" Value="getSelectedCoreTaskId()" Mode="Raw" />
                                        </BaseParams>
                                        <Reader>
                                            <ext:JsonReader IDProperty="Id">
                                                <Fields>
                                                    <ext:RecordField Name="Id">
                                                    </ext:RecordField>
                                                    <ext:RecordField Name="Name">
                                                    </ext:RecordField>
                                                </Fields>
                                            </ext:JsonReader>
                                        </Reader>
                                    </ext:Store>
                                </Store>
                            </ext:SelectBox>
    and in button click handler, I use javascript to load data from server.
    the code is below:
     StoreWorkgroupForCoreTask.load();
    The method in server side is working correctly. I can see there are some data send back.
    The problem is when the data send back from server, the store didn't load the data from server.
    Last edited by Daniil; May 31, 2011 at 3:55 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Quote Originally Posted by leon_tang View Post
    The method in server side is working correctly. I can see there are some data send back.
    Please post a response.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,



    Please post a response.
    Here is the content of response:

    {result:[{"Id":2582,"Name":"Alex_Team_1","FirstDayOfWeek":"Tuesday","FirstDayOfWeekHasBeenConfigured":true},{"Id":2641,"Name":"Test Team A1","FirstDayOfWeek":"Sunday","FirstDayOfWeekHasBeenConfigured":true},{"Id":2642,"Name":"Test Team A2","FirstDayOfWeek":"Sunday","FirstDayOfWeekHasBeenConfigured":true},{"Id":2643,"Name":"Test Team B1","FirstDayOfWeek":"Sunday","FirstDayOfWeekHasBeenConfigured":true},{"Id":2644,"Name":"Test Team B2","FirstDayOfWeek":"Sunday","FirstDayOfWeekHasBeenConfigured":true},{"Id":2645,"Name":"Test Team C1","FirstDayOfWeek":"Sunday","FirstDayOfWeekHasBeenConfigured":true},{"Id":2646,"Name":"Test Team C2","FirstDayOfWeek":"Sunday","FirstDayOfWeekHasBeenConfigured":true},{"Id":2647,"Name":"Test Team D1","FirstDayOfWeek":"Sunday","FirstDayOfWeekHasBeenConfigured":true},{"Id":2648,"Name":"Test Team D2","FirstDayOfWeek":"Sunday","FirstDayOfWeekHasBeenConfigured":true}]}
  4. #4
    Please set Root="result" for the JsonReader.
  5. #5
    Add it and it works now. Thank you very much

Similar Threads

  1. [CLOSED] Example of loading user control with data binding
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Aug 18, 2012, 7:01 AM
  2. [CLOSED] Fill dynamic ComboBox data on server side
    By imaa in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 07, 2012, 7:56 AM
  3. Replies: 4
    Last Post: Oct 24, 2011, 3:34 AM
  4. [CLOSED] Loading data from server to store by javascript
    By leon_tang in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Apr 21, 2011, 4:44 PM
  5. [CLOSED] Combobox Data Binding Problem
    By Vasudhaika in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 09, 2011, 1:55 PM

Posting Permissions