如何使用多个条件查找行

时间:2017-06-18 17:35:36

标签: javascript jquery

这是一个getData方法,我无法使用多个条件获取行。 因为我试图设置行条件匹配的输入值。但它还没有工作

function getData() {

    $.ajax({
        type: 'POST',
        url: APIUrl + 'api/GetCustomerProductDetailsDetailByEmployeeID?JSONStringData=' + JSON.stringify(objReqCustomerProductDetails),
        dataType: 'json',
        contentType: 'application/json; charset=utf-8',
        crossDomain: true,
        success: function (data, textStatus, xhr) {
            objResCustomerProductDetails = data;

            if ($(objResCustomerProductDetails.CustomerProductDetails).length > 0) {

                $.each(objResCustomerProductDetails.CustomerProductDetails, function () {

                    $('#tbCustomer tbody tr[data-id=' + this.CustomerID + ' data-product-id=' + this.ProductID + '] td').find('input').val(parseFloat(this.Quantity.toString().trim()).toFixed(2));

                });
            }

        },
        error: function (xhr, textStatus, errorThrown) {

            messageProvider(0, errorThrown);
        }
    });
}

1 个答案:

答案 0 :(得分:2)

BoxLayout:

    orientation:'vertical'
    canvas.before:
        Rectangle:
            source:'back_azul.png'
            pos: self.pos
            size: self.size

    BoxLayout:
        orientation:'horizontal'
        height:'30dp'
        size_hint_y:None

        Button:

            size_hint_x:0.25
            text:"Back to Menu"

            opacity: 1 if self.state == 'normal' else .5
            background_color:0,0,0,0
            on_release:app.root.current="main"
            font_size:20





    BoxLayout:
        background_color:0,10,10,1
        padding:5
        Image:
            source:"camisa.jpg"

        Label:
            text:"01 Camisa social"
            bold:True
            font_size:11
        Label:
            text:"R$: 8,00"
            font_size:15

    BoxLayout:
        padding:5
        Image:
            source:"peca.jpg"

        Label:
            text:"01 Camisa Polo"
            font_size:11
            bold:True

        Label:
            text:"R$:6,00"
            font_size:10
    BoxLayout:
        padding:5
        Image:
            source:"terno.jpg"

        Label:
            text:"01 Terno c/Calca"
            font_size:11
            bold:True
        Label:
            text:"R$: 28,00"
            font_size:10
    BoxLayout:
        padding:5
        Image:
            source:"vestido.jpg"
        Label:
            text:"01 Vestido"
            font_size:11
            bold:True
        Label:
            text:"R$: 70,00"
            font_size:10

属性结束后,您需要关闭它。公约是$('#tbCustomer tbody tr[data-id=' + this.CustomerID + '][data-product-id=' + this.ProductID + '] td').find('input').val(parseFloat(this.Quantity.toString().trim()).toFixed(2)); 。这是上述代码的问题。

参考:https://api.jquery.com/multiple-attribute-selector/