[CLOSED] Get comobobox value and send it to javascript function

  1. #1

    [CLOSED] Get comobobox value and send it to javascript function


    I have a combo box column and I want to get one of the items of the combo box and assign it to a main store column
    This is the definition code for the combo box column:

    <ext:ComponentColumn runat="server" Editor="true" DataIndex="articuloid" Text="Articulo" Width="265">
       <ext:ComboBox runat="server" Editable="false" DisplayField="descripcion" ValueField="id" EmptyText="Seleccione un articulo" AllowBlank="False">                        
                <ext:Store ID="ArtList" runat="server" DataSourceID="SqlDataSourceArticulos">
                         <ext:Model runat="server">
                                 <ext:ModelField Name="id" />
                                 <ext:ModelField Name="descripcion" />
                                 <ext:ModelField Name="cantidad" />
                 <Select Handler="var record = records[0]; #{Disponible}.value = this.getStore().cantidad; "></Select>
                 <ItemTpl runat="server">
                        <div class="list-item">
    When the user see the field on the page it looks like this
    Click image for larger version. 

Name:	ComboBox.PNG 
Views:	2 
Size:	16.4 KB 
ID:	25120

    In the image, you can see, the name of the article and a quantity available.
    When the user select one of the items, the combo box take the id (<ext:ModelField Name="id" />) and thats the value will be assign to the column (<ext:ComponentColumn runat="server" Editor="true" DataIndex="articuloid" Text="Articulo" Width="265">)

    But I want to get another value of the combo box, the <ext:ModelField Name="cantidad" /> and assign the value to the column <ext:Column ID="Disponible" runat="server" DataIndex="disponible" Text="Disp" Width="0"> </ext:Column>

    In the image per example, if the user select
    BlueRay Player
        articuloid = 1
        disponible = 9
    Televisor LED 50"
        articuloid = 5
        disponible = 20
    How can I get the <ext:ModelField Name="cantidad" />, when the user select an item from the combo box????

    Last edited by fabricio.murta; Mar 17, 2018 at 6:17 AM. Reason: Format post
  2. #2
    Hello @aemiranda!

    The record variable has all you want. By what you describe, it will be record.getData().cantidad. Or, rather record.set("cantidad", value_from_combobox).

    I hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3


    Thanks fabricio.
    The first solution you wrote works: record.getData().cantidad


Similar Threads

  1. Replies: 1
    Last Post: Feb 10, 2015, 3:45 AM
  2. [CLOSED] Get javascript function's value
    By multimediait in forum 2.x Premium Help
    Replies: 6
    Last Post: Oct 24, 2014, 10:20 AM
  3. Replies: 3
    Last Post: Oct 23, 2013, 3:30 PM
  4. Calling JavaScript function
    By UserClarion in forum 1.x Help
    Replies: 2
    Last Post: Dec 30, 2011, 10:23 AM
  5. Replies: 1
    Last Post: Apr 08, 2010, 6:28 PM

Posting Permissions