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

159
6
Jump to solution
2 weeks ago
emreaktas1
New Contributor II
  • 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

6 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
New Contributor II

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
New Contributor II

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
New Contributor II

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