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

Threaded 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" >
                        <ext:RecordField Name="text" Type="String" />
                        <ext:RecordField Name="value" Type="String" />
    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"
                                                <Template ID="Template1" runat="server">
                                                        <tpl for=".">
                                                              <div class="search-item"> 
                                                                      <img src="../../images/{Image}" />{Name}  
                                                    <Select Handler=" addMultiSelectNew(this,#{msAttendees},#{attendeesSelected},#{hidAttendeeIds});    if(#{contactSearch}.data.length>1)  #{ComboBox1}.expand();#{ComboBox1}.reset(); " />
    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">
    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());
        catch (eer) {
    Last edited by Daniil; Dec 03, 2010 at 10:49 AM. Reason: [CLOSED]

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