jeudi 8 septembre 2016

ember data model with id from created record howto?

i create a ember model with the following elements. Is it possible to set the equalTo in invoiceRows to the id of the newly created invoice ????

  model: function() {
    return Ember.RSVP.hash({
        parameter: this.store.findRecord('parameter',1),
        invoice: this.store.createRecord('customerinvoice',{
            order_reference : '',
            ordernr_bol: '',
            payment_method: '',
            invoice_type: '',
            company_name: '',
            customer_city: '',
            customer_country: '',
            customer_email: '',
            customer_first_name: '',
            customer_name: '',
            customer_phone: '',
            customer_phone_mobile: '',
            customer_postal_code: '',
            customer_street_nr: '',
            customer_vat_number: '',
        }),
        customers: this.store.findAll('customer'),
        invoiceRows: this.store.query('customerinvoicerow', {
            orderBy: 'id_cust_invoice_fb',
            equalTo: **THIS MUST BE ID OF CREATED INVOICE ???????**
        }),
        products: this.store.findAll('product')
    });
},




Aucun commentaire:

Enregistrer un commentaire