green3g / cmv-widgets

Dojo Widgets to extend the functionality of CMV
https://roemhildtg.github.io/cmv-widgets/
MIT License
19 stars 29 forks source link

Trying to embed Related tables widget into identify info window #16

Closed MesquiteGIS closed 9 years ago

MesquiteGIS commented 9 years ago

I've been trying to get the related table widget to work within the identify info window with out any luck. I've updated to the latest version, and tried adding in the suggested code. Doing this disables the identify pop up all together. Any suggestions?

green3g commented 9 years ago

@MesquiteGIS can you post what you've done? It will be easier to help if I can see your code.

MesquiteGIS commented 9 years ago

Sure, thanks....

in the identify.js config I added:

define([ 'dojo/dom-construct', 'dijit/layout/TabContainer', 'dijit/layout/ContentPane', 'gis/CMV_Widgets/widgets/RelationshipTable/RelationshipTable'//path is relevant to wherever you placed the file ], function (domConstruct, TabContainer, ContentPane, RelationshipTable){

    var formatters = {
    relationship: function (relationship) {
       return function (data) {
           var container = new TabContainer({
               style: 'width:100%;height:300px;'
           }, domConstruct.create('div'));
           container.startup();
           //delay then resize
           setTimeout(function () {
               container.resize();
           }, 200);
           container.addChild(new RelationshipTable(lang.mixin({
               attributes: data.attributes,
               title: 'Related Records',
               style: 'width:100%;'
           }, relationship)));
           return container.domNode;
       };
    }
};

.....and then in the gis\dijit\Identify.js file I added/ modified:

getInfoTemplate: function (layer, layerId, result) { var popup = null,

MesquiteGIS commented 9 years ago

Also, just out of curiosity, how do i get my code to show up as code in these posts? Always hit or miss. Sorry, noob question.

green3g commented 9 years ago

That's a good question. Just put three of those dashes that look like apostrophe's in a row, and three more to end it. Its the key below the Esc button::` See here

green3g commented 9 years ago

So I found a slight problem, the docs I had didn't include dojo/_base/lang. After adding that I was able to get the widget to work. A proxy is required, are you using a esri proxy??

MesquiteGIS commented 9 years ago

Hi Gregg,

My application works using the related records widget, however, the table doesn't always populate. Sometimes it takes several clicks on a feature for the related records to show up for that feature. Have you experienced this at all? Could it be that my proxy is not configured properly, or would the widget not work at all if it was due to the proxy?

Thanks,

Ryan

On Mon, Jul 27, 2015 at 6:29 PM, Gregg Roemhildt notifications@github.com wrote:

So I found a slight problem, the docs I had didn't include dojo/_base/lang. After adding that I was able to get the widget to work. A proxy is required, are you using a esri proxy https://developers.arcgis.com/javascript/jshelp/ags_proxy.html??

— Reply to this email directly or view it on GitHub https://github.com/roemhildtg/CMV_Widgets/issues/16#issuecomment-125400941 .

Ryan Kammerer, GISP GIS/Programmer Analyst II City of Mesquite, Nevada (702) 346-8647 Ext. 4

Confidentiality Statement:

The information contained in this electronic mail is confidential information. This information may be attorney/client privileged and is intended only for the use of the individual or entity named above.

If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, copying, or re-transmission of this message is in violation of 18 U.S.C. 2511(1) of the ECPA and is strictly prohibited. If you have received the message in error, please notify the sender immediately. Thank you.

green3g commented 9 years ago

It could be a proxy config problem. It would be difficult for me to say though. If you open up chrome or firebug network debugger and compare the results of a failed identify and successful one does anything stand out?

green3g commented 9 years ago

@MesquiteGIS were you able to get this figured out?

MesquiteGIS commented 9 years ago

@roemhildtg , Hi Gregg, thanks for checking up on this. Sorry, took me awhile to get back to this project. I still haven't got the related tables widget to work 100% for my application.

http://mesquitenvpavement.appspot.com/

As you can see, when clicking on a new street segment, the identify widget works every time, but the related table doesn't show new records every time. Cant seem time figure out why. If i go back and forth, I'm eventually able to get the related table to populate.

Any suggestions?

Thanks

green3g commented 9 years ago

Its an odd issue. I actually experienced this occasionally before I switched over to putting the table in the identify popup.

Here's a couple things you can try, let me know if they help at all.

  1. Turn the opacity off on the feature layer. Make sure it is indeed showing up in those areas where the related records don't load.
  2. Make the line width a lot wider on the feature layer. The related record widget is triggered on the feature layer 'click' event and if the click isn't close enough to the feature layer, it will still identify but it won't trigger the related records.
MesquiteGIS commented 9 years ago

@roemhildtg Success!!! Your second suggestion of making the line width a lot wider worked! It never occurred to me to try that. Thank you so much for the suggestion. I think originally the width of that feature layer was set at .4, so I upped it up to 10 with no color and it now works beautifully.

Thanks again, much appreciated