[CLOSED] Adding Items to Store Client-side, want to retrieve server side

Hybrid View

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

    [CLOSED] Adding Items to Store Client-side, want to retrieve server side

    Hi, I have a combo box where users select items.
    I have a multiselect that lists all of the selected items.
    The multi-select is bound to a simple store.

    When the user submits to the server, I want to get at the data that has been added to the store...
    The Item collection of the multiselect is empty...and I can't see to find where to obtain the data in the store..

    Do I need to commit or save the store? That doesn't seem to work either...



      <ext:Store ID="attendeesSelected" runat="server" AutoDataBind="true" AutoLoad="true" >
            <Reader>
                <ext:JsonReader>
                    <Fields>
                        <ext:RecordField Name="text" Type="String" />
                        <ext:RecordField Name="value" Type="String" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
    The combo box lets users search for people

     <ext:ComboBox ID="ComboBox1" runat="server" AllowBlank="true" BlankText="Type to search"
                                                EmptyText="Attendees" StyleSpec="background:#fff  url('../../extnet/icons/magnifier.png') no-repeat right;"
                                                StoreID="contactSearch" DisplayField="Name" ValueField="Url" TypeAhead="false"
                                                LoadingText="Searching..." Width="250" Height="200" HideTrigger="true" ItemSelector="div.search-item"
                                                MinChars="1">
                                                <Template ID="Template1" runat="server">
                                                    <Html>
                                                        <tpl for=".">
                                                              <div class="search-item"> 
                                                                      <img src="../../images/{Image}" />{Name}  
                                                              </div></tpl>
                                                    </Html>
                                                </Template>
                                                
                                                <Listeners>
                                                    <Select Handler=" addMultiSelectNew(this,#{msAttendees},#{attendeesSelected},#{hidAttendeeIds});    if(#{contactSearch}.data.length>1)  #{ComboBox1}.expand();#{ComboBox1}.reset(); " />
                                                </Listeners>
                                            </ext:ComboBox>
    The multi select just displays the selected items..
    <ext:MultiSelect ID="msAttendees" StoreID="attendeesSelected" DisplayField="text"
                                                ValueField="value" runat="server" Width="250" AutoHeight="true" MaxHeight="150"
                                                SortField="text" AllowDuplicates="false" KeepSelectionOnClick="WithCtrlKey">
                                                <Items>
                                                </Items>
    </ext:MultiSelect>
    The magic happens in my javascript method that adds text/value to the store from the selected combobox:

    
    
    function addMultiSelectNew(t, multiSelect, store, hiddenIds) {
        try {
            var multi = multiSelect;
            var entityTypeId;
            var entityId;
            var displayField = multi.displayField;
            var valueField = multi.valueField;
    
    
            var f = store.recordType.prototype.fields, dv = [];
            for (var i = 0; i < f.length; i++) {
                dv[f.items[i].name] = f.items[i].defaultValue;
            }
            var record = new store.recordType(dv);
    
     
            record.set(displayField,  t.getText());
            record.set(valueField, t.getValue());
    
          
    
            store.add([record]); 
        }
        catch (eer) {
    
        }
    }
    Last edited by Daniil; Dec 03, 2010 at 10:49 AM. Reason: [CLOSED]
  2. #2
    Hi,

    The reason of this issue is the same as it was it this thread
    http://forums.ext.net/showthread.php...n-a-data-store

    See the fourth post to get an explanation of the problem.

    You could use the Store's submitData() method with a respective server side handler. Also you could send Store's data as extra parameter of a common DirectEvent.

Similar Threads

  1. Adding an event to Msg button from a client side?
    By ascsolutions in forum 1.x Help
    Replies: 3
    Last Post: Jan 24, 2012, 11:47 AM
  2. Replies: 3
    Last Post: Dec 26, 2011, 1:32 PM
  3. [CLOSED] Add items to RadioGroup from client side
    By softmachine2011 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Apr 09, 2011, 12:58 PM
  4. Replies: 4
    Last Post: Mar 19, 2010, 11:35 AM
  5. Replies: 6
    Last Post: Sep 01, 2009, 1:06 PM

Posting Permissions