How to make the Edit Widget feature attribute Popup Draggable

1081
2
Jump to solution
11-21-2017 05:07 AM
RichBell
Occasional Contributor

Please help.....

What code changes are necessary to make the popup feature attribute table of the Edit Widget and Smart Editor Widget draggable? I was able to do this with normal popups within the Foldable Theme but not with the editors attribute popup.

Rich

1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Rich,

   Here is how to do that. In the Widget.js.

(lines 32 and 37 make sure to add the comma on line 31 too):

define([
    'dojo/_base/declare',
    'dojo/_base/lang',
    'dojo/_base/array',
    'dojo/_base/html',
    'dojo/i18n!esri/nls/jsapi',
    'dojo/on',
    'dojo/query',
    'dojo/json',
    'dojo/Deferred',
    'dojo/aspect',
    'dojo/promise/all',
    'dijit/_WidgetsInTemplateMixin',
    'jimu/BaseWidget',
    'jimu/MapManager',
    'jimu/LayerInfos/LayerInfos',
    'jimu/dijit/LoadingShelter',
    'jimu/utils',
    'jimu/portalUrlUtils',
    'jimu/SelectionManager',
    'jimu/Role',
    'esri/dijit/editing/Editor',
    'esri/dijit/Popup',
    "esri/dijit/editing/TemplatePicker",
    "esri/geometry/Extent",
    "esri/geometry/Point",
    "esri/renderers/jsonUtils",
    "dijit/form/Button",
    "./utils",
    './FilterEditor',
    './RelatedRecordsEditor',
    'dojo/dnd/Moveable'
  ],
  function(declare, lang, array, html, esriBundle, on, query, Json, Deferred, aspect, all,
    _WidgetsInTemplateMixin, BaseWidget, MapManager, LayerInfos, LoadingShelter,
    jimuUtils, portalUrlUtils, SelectionManager, Role, Editor, Popup, TemplatePicker,
    Extent, Point, rendererJsonUtils, Button, editUtils, FilterEditor, RelatedRecordsEditor, Moveable) {

Add lines 8 - 11:

      startup: function() {
        this.inherited(arguments);
        this.editPopup = new Popup(null, html.create("div",
                                                    {"class":"jimu-widget-edit-infoWindow"},
                                                    null,
                                                    this.map.root));

        var handle = query(".title", this.editPopup.domNode)[0];
        var dnd = new Moveable(this.editPopup.domNode, {
            handle: handle
        });
        this.loading = new LoadingShelter({
          hidden: true
        });
        this.loading.placeAt(this.domNode);
      },

View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Emeritus

Rich,

   Here is how to do that. In the Widget.js.

(lines 32 and 37 make sure to add the comma on line 31 too):

define([
    'dojo/_base/declare',
    'dojo/_base/lang',
    'dojo/_base/array',
    'dojo/_base/html',
    'dojo/i18n!esri/nls/jsapi',
    'dojo/on',
    'dojo/query',
    'dojo/json',
    'dojo/Deferred',
    'dojo/aspect',
    'dojo/promise/all',
    'dijit/_WidgetsInTemplateMixin',
    'jimu/BaseWidget',
    'jimu/MapManager',
    'jimu/LayerInfos/LayerInfos',
    'jimu/dijit/LoadingShelter',
    'jimu/utils',
    'jimu/portalUrlUtils',
    'jimu/SelectionManager',
    'jimu/Role',
    'esri/dijit/editing/Editor',
    'esri/dijit/Popup',
    "esri/dijit/editing/TemplatePicker",
    "esri/geometry/Extent",
    "esri/geometry/Point",
    "esri/renderers/jsonUtils",
    "dijit/form/Button",
    "./utils",
    './FilterEditor',
    './RelatedRecordsEditor',
    'dojo/dnd/Moveable'
  ],
  function(declare, lang, array, html, esriBundle, on, query, Json, Deferred, aspect, all,
    _WidgetsInTemplateMixin, BaseWidget, MapManager, LayerInfos, LoadingShelter,
    jimuUtils, portalUrlUtils, SelectionManager, Role, Editor, Popup, TemplatePicker,
    Extent, Point, rendererJsonUtils, Button, editUtils, FilterEditor, RelatedRecordsEditor, Moveable) {

Add lines 8 - 11:

      startup: function() {
        this.inherited(arguments);
        this.editPopup = new Popup(null, html.create("div",
                                                    {"class":"jimu-widget-edit-infoWindow"},
                                                    null,
                                                    this.map.root));

        var handle = query(".title", this.editPopup.domNode)[0];
        var dnd = new Moveable(this.editPopup.domNode, {
            handle: handle
        });
        this.loading = new LoadingShelter({
          hidden: true
        });
        this.loading.placeAt(this.domNode);
      },
RichBell
Occasional Contributor

Thank You!

Works perfect!

0 Kudos