Edit data store to MongoDB (MEAN)

2903
5
Jump to solution
07-13-2016 02:05 AM
WildiyantoYawin
New Contributor

ss.png

hi,

i got a marker points and attributes that i store on MongoDB, i use MEAN to create this web. But i got a problem when i want to edit my data.

How do i edit data on that popup? Or is there any others way to edit when i click the marker point?

Thanks

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Frequent Contributor

You can customize the PopupTemplate however you want.

Get started with PopupTemplate | ArcGIS API for JavaScript 4.0

You can also define custom actions for the Popup.

Define custom Popup actions | ArcGIS API for JavaScript 4.0 

View solution in original post

5 Replies
ReneRubalcava
Frequent Contributor

The JS API doesn't provide specific editing support for external services/db like MongoDB. 4.0 doesn't have editing currently, but even in 3.x you can only edit FeatureServices.

In both 3.x and 4.x you'll need to create a custom interface to edit your MongDB data.

In 3.x, you'll want to do something similar to this sample.

ArcGIS API for JavaScript Sandbox

Where you can move the points, updating the coordinates and then you will need to publish those updates back to your service via a CRUD API of your own.

WildiyantoYawin
New Contributor

Thank you Rene Rubalcava for the answer.

Okay. So is there a way to retrive data on the marker that i click?

I want to get data attribute and put it on my input field on the right bottom div.

sss.png

Thank You.

0 Kudos
ReneRubalcava
Frequent Contributor

You can use the "click" event of the View and "view.hitTest()" as shown here.

MapView | API Reference | ArcGIS API for JavaScript 4.0

0 Kudos
WildiyantoYawin
New Contributor

Thank you again Rene Rubalcava

I want to ask more.

From the first image. It got a popup when i click on the points. In place of email and phone number, i want to show a "Click to show email" and "Click to show phone" to avoid bot. Is there any method to do this?

//Update

i tried jQuery. but i think jQuery doesnt work on Popup? because i try to add class to the div and console log but nothing happened.

0 Kudos
ReneRubalcava
Frequent Contributor

You can customize the PopupTemplate however you want.

Get started with PopupTemplate | ArcGIS API for JavaScript 4.0

You can also define custom actions for the Popup.

Define custom Popup actions | ArcGIS API for JavaScript 4.0