AnsweredAssumed Answered

How to use RangeValue domains in ArcGIS JavaScript API

Question asked by geoffreywestgis on Oct 6, 2014
Latest reply on Oct 14, 2014 by geoffreywestgis

I have a combo box that I would like to use a range value instead of the coded value.  What is the proper syntax?  Now I am attempting domain.ranges to no avail.

 





function PopulateQuantity(serviceRequestLayerFieldsQuantity) {
    var serviceRequestFieldsQuantity
    for (var i = 0; i < serviceRequestLayerFieldsQuantity.length; i++) {
        if (serviceRequestLayerFieldsQuantity[i].name == serviceRequestLayerInfo.QuantityFieldName) {
            serviceRequestFieldsQuantity = serviceRequestLayerFieldsQuantity[i].domain.ranges;
            break;
        }
    }


    var Quantity = { identifier: "id", items: [] };
    for (var i = 0; i < serviceRequestFieldsQuantity.length; i++) {
        serviceRequestFieldsQuantity.items[i] = { id: serviceRequestFieldsQuantity[i].name, name: serviceRequestFieldsQuantity[i].name };
    }
    var QuantityStore1 = new dojo.data.ItemFileReadStore({ data: QuantityFieldType });
    dijit.byId('cbQuantity').attr('store', QuantityStore1);
}
function PopulateQuantity(serviceRequestLayerFields) {
    var serviceRequestFields
    for (var i = 0; i < serviceRequestLayerFields.length; i++) {
        if (serviceRequestLayerFields[i].name == serviceRequestLayerInfo.QuantityFieldName) {
            serviceRequestFields = serviceRequestLayerFields[i].domain.ranges;
            break;
        }
    }


    var QuantityType = { identifier: "id", items: [] };
    for (var i = 0; i < serviceRequestFields.length; i++) {
        QuantityType.items[i] = { id: serviceRequestFields[i].name, name: serviceRequestFields[i].name };
    }
    var QuantityStore = new dojo.data.ItemFileReadStore({ data: QuantityType });
    dijit.byId('cbQuantity').attr('store', QuantityStore);
}



Outcomes