0

I am wondering the purpose and correct usage of the readOnly attribute of the FeatureTable widget in the ArcGIS Javascript API. The API defines it as a varible which "Indicates whether the data is editable via the widget." The API does not indicate it is a parameter that is set in the widget's constructor.

How is it used?

It would be great if there were a way to edit data within the FeatureTable object. However, I have tried both of the following implementations of code to no avail.

Nor have I found a code sample which uses this attribute.

Any ideas?

Option 1: Declare in the constructor despite API documentation

projectsTable = new FeatureTable({
    "featureLayer" : projects,
    "selectionMode": "single",
    "readOnly": false
}, 'grid');
projectsTable.startup();

Option 2: Manually declare after the FeatureTable is instantiated

projectsTable = new FeatureTable({
    "featureLayer" : projects,
    "selectionMode": "single"
}, 'grid');
projectsTable.readOnly = false;
projectsTable.startup();

1 Answer 1

1

The readyOnly property is not something that can be passed within the object constructor, otherwise it would appear here in the API reference.

while technically JavaScript doesn't prevent you from 'setting' any property you like, in the JSAPI some properties are only intended to pass on information to the developer from the service itself.

given the language in the documentation, my guess is that the readOnly property is readOnly :).

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.