-1

From the code it looks like the object does not support the property.

function _isLabelForDisplayablePrice(label, scope) {
    var g = self.data.general,
    checkedPriceVals = g[scope + 'VehicleConfig'].displayablePrices(),
    priceObjects = g[scope + 'VehicleConfig'].featuredPrices();

    for (var i = 0; i < priceObjects.length; i++) {
        // Find the parent object of the label field
        if(label.name() == priceObjects[i].fields.label.name()) {
            // Return true if displayable is checked
            return checkedPriceVals.indexOf(priceObjects[i].fields.displayable.value())  >= 0;
        }
    }

    // should never reach here, but just in case
    return false;
}
sWW
  • 585
  • 4
  • 13

2 Answers2

1

Is use $.inArray instead of indexOf, or maybe you can define the method:

if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (obj, start) {
    for (var i = (start || 0), j = this.length; i < j; i++) {
        if (this[i] === obj) { return i; }
    }
    return -1;
}
}
0

Try this

    return checkedPriceVals.toString()
.indexOf(priceObjects[i].fields.displayable.value())>=0;

it will work.

Pandiyan Cool
  • 6,381
  • 8
  • 51
  • 87