Disabled Field Style in Attribute Inspector

1978
4
03-11-2016 11:16 AM
by Anonymous User
Not applicable

In this sample​ the fields where editing is disabled  grey themselves out. In my application editing is disabled, but the styling doesn't change. Where in the code does that happen? I tried using the Claro theme instead of Nihilo but that didn't do it.

Thanks!

Tags (1)
0 Kudos
4 Replies
TimWitt2
MVP Alum

Are you using the attribute inspector to just show a pop-up?

If you set all the isEditable values to false it should grey them all out.

{'fieldName': 'Rd_64_Venue', 'isEditable': false, 'label': 'Rd 1 Venue:'},

0 Kudos
by Anonymous User
Not applicable

I have a Popup in the map InfoWindow without any editing allowed at first, and then there is an 'Edit' button the user clicks in order to edit fields. Then I clear the Popup content and use the Attribute Inspector in the map InfoWindow. Code snippets:

arc.map = {
            modules : {
                map : new Map("map", {
                    basemap : "topo",
                    center : [-98, 39],
                    zoom : 4,
                    showAttribution : false,
                    logo : false,
                    showInfoWindowOnClick : true,
                    infoWindow : new Popup({
                        anchor : "top-right"
                    }, domConstruct.create("div"))
                })
            }
        }

function inspector(layer, map, feature, dg, track, sym) {
            var that = this;
            var fEdit = feature;
            var infoObj = [];
            // Special field editing settings for arrays
                arrayUtils.forEach(layer.fields, function(atts) {
                    if (atts.name.search('OBJECTID') == -1) {
                        if (atts.name.search('Shape') == -1) {
                            if (atts.name == 'Status') {
                                var objField = {};
                                objField['fieldName'] = atts.name;
                                objField['label'] = atts.alias;
                                objField['isEditable'] = true;                               
                                infoObj.push(objField);
                            } else {
                                var objField = {};
                                objField['fieldName'] = atts.name;
                                objField['label'] = atts.alias;
                                objField['isEditable'] = false;
                                infoObj.push(objField);
                            };
                        };
                    };
                });

            var layerInfosVar = this.layerInfos(layer, infoObj);
            var attIn = new AttributeInspector({
                layerInfos : layerInfosVar
            }, domConstruct.create('div'));   
          // BUG: clear -up first
            layer.setInfoTemplate();
            map.infoWindow.clearFeatures();
            map.infoWindow.setContent(attIn.domNode);
            return attIn;
        }
0 Kudos
TimWitt2
MVP Alum

When you run your code does it ever hit line 32 in the debugger?

0 Kudos
by Anonymous User
Not applicable

It does, yes

0 Kudos