[CLOSED] Read selected items server side (additional columns)

  1. #1

    [CLOSED] Read selected items server side (additional columns)

    Hi

    Lets say we have a multi column & multi select combo with 5 different columns.
    In jscript I read the selected items value for the other columns like this

    var value = combo.getValue();
    combo.findRecordByValue(value).data.Column1);
    combo.findRecordByValue(value).data.Column2);
    How do I this from server code as the SelectedItems only contains Text and Value and not any of the additional columns (or at least that I can tell)?

    Ta,
    Dan
    Last edited by Daniil; Aug 05, 2014 at 12:59 PM. Reason: Please use [CODE] tags, [CLOSED]
  2. #2
    What column do yuo mean? I am not sure what means column on Combobox context
    Can you provide test sample?

    Also, if you can extract required information via javascript then you can send it to the server as extra parameter of direct event
    Vladimir Shcheglov
    Sr. Developer
  3. #3
    Hi Vlad

    By the additional columns I mean those extra columns on the store shown for a multi column combo

    
                                    <ext:MultiCombo ID="_Analysis" runat="server" MatchFieldWidth="true"   Flex="1" FieldLabel="Analysis Name" ValueField="AnalysisID" DisplayField="AnalysisName" >
    
                                        <Store>
                                            <ext:Store ID="stAnalysis" runat="server">
                                                <Model>
                                                    <ext:Model ID="mdlAnalysis" runat="server" IDProperty="AnalysisID">
                                                        <Fields>
                                                            <ext:ModelField Name="AnalysisID" />
                                                            <ext:ModelField Name="AnalysisName" />
                                                            <ext:ModelField Name="AnalysisDescription" />
                                                            <ext:ModelField Name="AnalysisCurrency" />
                                                        </Fields>
                                                    </ext:Model>
                                                </Model> 
                                            </ext:Store> 
                                        </Store>
    Given it is also a multi select combo I would need to wrap up all selected items and post them to server. It would also not be very clean as this happens behind a save event of a button click so I would end up writing quite a bit of code whereas it would be far easier if I could simply read the other columns (Description and Currency) as part of the selecteditems.

    Ta,
    D
  4. #4
    I see, under column you mean additional store fields
    A store can contain many fields but combo works with only two fields: display field and value field
    If you need additional field then you have to submit it manually via extra parameters of direct event

    Or just get store data on the server and read records by value (i mean that you should know what data inside the store and you can get that data (for example, read from DB and etc) on the server)
    Vladimir Shcheglov
    Sr. Developer
  5. #5
    Thanks Vlad.

    Yeah I pretty guessed that would be the case. The way I see it is there are 3 options.

    1. Wrap up the selected items and pass them thru a listener / event.

    2. Go back to the db, in this case everything about how they are retrieved in the first place is dynamic (including servers & dbs) -- I can certainly do it this way but it is potentially expensive and is shame given we have the data.

    3. Persist the data on the server and lookup from there.

    Either way I think the problem might more to be with me trying to do too much using a multi column & multi select combo. I also have it working now using display text and display value (although I can see the need for further fields).

    Thanks,
    D
  6. #6
    Hi @CanopiusApplications,

    but it is potentially expensive and is shame given we have the data.
    Yes, it is a proper principle not to retrieve the data again if you already have it.

    I think you can send anything that required from client. As far as I can understand you have stated it in the option #1.

Similar Threads

  1. [CLOSED] Get visible GridPanel columns from server side
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 20, 2013, 12:22 AM
  2. [CLOSED] Add Columns to GridPanel. Server side
    By Antonio09 in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: Oct 30, 2012, 1:42 AM
  3. Replies: 1
    Last Post: Dec 01, 2010, 5:14 PM
  4. Replies: 0
    Last Post: Sep 20, 2010, 11:45 AM
  5. Cannot add gridpanel columns on server side
    By cmschick in forum 1.x Help
    Replies: 2
    Last Post: Feb 16, 2009, 7:19 AM

Posting Permissions