Update to 3.10 changes to attributeInspector new button syntax?

717
1
Jump to solution
08-21-2014 02:23 PM
ShaneLim
Occasional Contributor

When I change my js reference from 3.9 to 3.10 I get an error in my code that creates a print button in the attributeInspector.  Does anybody know what the new syntax change should be or where to look?  I think its in the new dojo dijt but I am not sure. I get an error of :

"JavaScript runtime error: Unable to get property 'editButtons' of undefined or null reference"

                var printButton = new Button({

                    label: "Print", onClick: function () {

                        var workIDtoPrint = myEditor.attributeInspector.layerInfos[0].fieldInfos[0].dijit.value

                        print(workIDtoPrint)

                    }

                }, domConstruct.create("div", null, myEditor.attributeInspector.editButtons, "first"));

                domClass.add(printButton.domNode, "atiMyButton");

0 Kudos
1 Solution

Accepted Solutions
RiyasDeen
Occasional Contributor III

Hi Shane,

Apparently you need to call Editor.startup() before you can access attributeInspector in 3.10 in 3.9 it was the case, attributeInspector was available before startup.

Refer image below on the left is myEditor after startup() is called. Used this sample for testing Edit rivers and waterbodies‌.Untitled.png

View solution in original post

1 Reply
RiyasDeen
Occasional Contributor III

Hi Shane,

Apparently you need to call Editor.startup() before you can access attributeInspector in 3.10 in 3.9 it was the case, attributeInspector was available before startup.

Refer image below on the left is myEditor after startup() is called. Used this sample for testing Edit rivers and waterbodies‌.Untitled.png