[CLOSED] Get the Field of a Store

  1. #1

    [CLOSED] Get the Field of a Store

    Hi, How Can I get the Field "Precio" in the next code:

                <Store>
                    <ext:Store ID="sAgregarCita" runat="server">
                        <Listeners>
                            <Add Fn="sumarTotal" />
                        </Listeners>
                        <Model>
                            <ext:Model ID="mAgregarCita" runat="server">
                                <Fields>
                                    <ext:ModelField Name="Articulo" Type="String" />
                                    <ext:ModelField Name="Descripcion1" Type="String" />
                                    <ext:ModelField Name="TiempoEntregaSeg" Type="Int" />
                                    <ext:ModelField Name="TiempoEntrega" Type="Int" />
                                    <ext:ModelField Name="Precio" Type="Float" />
                                    <ext:ModelField Name="PDescuento" Type="Int" />
                                    <ext:ModelField Name="Descuento" Type="Boolean" />
                                    <ext:ModelField Name="Importe" Type="Date"/>
                                    <ext:ModelField Name="Fecha" Type="Date" />
                                    <ext:ModelField Name="Hora" Type="Boolean" />
                                    <ext:ModelField Name="Sala" Type="String" />
                                    <ext:ModelField Name="Medico" Type="String" />
                                    <ext:ModelField Name="Tecnico" Type="String" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
    var sumarTotal = function (store, data) {
        //Here I want to get the value to "Precio"
        console.log(data....);
    };
    I know that,Listener Add it has the parameter Store, Data and Column, but I don't know How Can I to get the value by the field "Precio" in the parameter data?
    Last edited by Baidaly; Oct 17, 2013 at 3:54 AM. Reason: [CLOSED]
  2. #2
    Hello!

    Your second arguments is an array of records so if should like in the sample below:

    http://docs.sencha.com/extjs/4.2.1/#...tore-event-add
    http://docs.sencha.com/extjs/4.2.1/#...del-method-get

    var sumarTotal = function (store, data) {
        //Here I want to get the value to "Precio"
        console.log(data[0].get('Precio'));
    };
  3. #3
    Quote Originally Posted by Baidaly View Post
    Hello!

    Your second arguments is an array of records so if should like in the sample below:

    http://docs.sencha.com/extjs/4.2.1/#...tore-event-add
    http://docs.sencha.com/extjs/4.2.1/#...del-method-get

    var sumarTotal = function (store, data) {
        //Here I want to get the value to "Precio"
        console.log(data[0].get('Precio'));
    };
    Thank you Baidaly

Similar Threads

  1. [CLOSED] store GetChangedData does not return id field
    By jchau in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 30, 2013, 8:43 PM
  2. Replies: 0
    Last Post: Nov 20, 2012, 1:08 PM
  3. Store data does not load in panel's field.
    By ankit in forum 1.x Help
    Replies: 0
    Last Post: May 25, 2010, 8:44 AM
  4. About store Field length
    By supermanok in forum 1.x Help
    Replies: 1
    Last Post: Jul 20, 2009, 8:46 AM
  5. Replies: 0
    Last Post: Apr 23, 2009, 7:43 AM

Tags for this Thread

Posting Permissions