Select to view content in your preferred language

Hello I'm new here. I search for layers with "esri/widgets/Search".

641
7
Jump to solution
04-30-2024 06:59 AM
emreaktas1
Regular Contributor
  • Merhaba burada yeniyim.
  • Katmanları "esri/widgets/Search" ile arıyorum.
  • Bu widget'ı istediğim konteynere nasıl yerleştirebilirim?
  • Örnek kod aşağıdaki gibidir.
    View.ui.add dosyasında konteyner kimliğini vermeme rağmen kullanamıyorum.

emreaktas1_0-1714485324297.png

  •  
0 Kudos
1 Solution

Accepted Solutions
JoelBennett
MVP Regular Contributor

If you want to place the Search widget in a container of your choosing, you should specify the ID of the container (or a reference to the container element) in the container property of the widget's constructor.  In this case, you would also not use view.ui.add.

const searchWidget = new Search({
    view: view,
    container: "myElementID",
    allPlaceholder: "Enter Search Text",
    //etc
});

View solution in original post

7 Replies
JoelBennett
MVP Regular Contributor

If you want to place the Search widget in a container of your choosing, you should specify the ID of the container (or a reference to the container element) in the container property of the widget's constructor.  In this case, you would also not use view.ui.add.

const searchWidget = new Search({
    view: view,
    container: "myElementID",
    allPlaceholder: "Enter Search Text",
    //etc
});
emreaktas1
Regular Contributor

Hello
I run a query by creating a query feature layer.
I have a small problem can you help me?

0 Kudos
JoelBennett
MVP Regular Contributor

Can you describe what problem you're having?

0 Kudos
emreaktas1
Regular Contributor

emreaktas1_0-1715544708639.png

I can get the results I want with the sample code.
I can see this with console.log.
How can I display this result in a container

0 Kudos
emreaktas1
Regular Contributor

emreaktas1_1-1715544906094.png

I want to show the result in a container.

0 Kudos
JoelBennett
MVP Regular Contributor

Perhaps this might be what you're trying to do:

let parselname = feature.attributes.adi_soyadi;
document.getElementById("sonuc").innerHTML = "Malik Bilgisi: " + parselname;
0 Kudos
emreaktas1
Regular Contributor

hi @JoelBennett 
I hope you are in good mood and health. everything is fine.
I want to serve a json data.
can you help with this?

0 Kudos