hi ![[bigsmile] [bigsmile] [bigsmile]](/data/assets/smilies/bigsmile.gif)
I am kind of new to dojo and I have a weird problem using it ...
My goal is to show some search results.
So I build a store, query it and display the results by adding a new div for each result :
where addRow basically calls
and it works fine
- i've got something like
Now, I want to open a window when one clicks on an "adresse" div - I add
and it still works fine
Great !!! how about adding a button that will hide non valid results ? let's go :
first add a
everything displays well, I still have my
with the data I want to display, I'm happy
...
... that is, until I click on a div to open the window ...![[sadeyes] [sadeyes] [sadeyes]](/data/assets/smilies/sadeyes.gif)
the
never fires
because
doesn't return anything ![[hairpull] [hairpull] [hairpull]](/data/assets/smilies/hairpull.gif)
anyone has a clue ?![[orientalbow] [orientalbow] [orientalbow]](/data/assets/smilies/orientalbow.gif)
i'm stuck :-/
![[bigsmile] [bigsmile] [bigsmile]](/data/assets/smilies/bigsmile.gif)
I am kind of new to dojo and I have a weird problem using it ...
My goal is to show some search results.
So I build a store, query it and display the results by adding a new div for each result :
JavaScript:
var adresseStore;
require([
"dojo/dom",
"dojo/store/Memory",
"dojo/dom-construct",
"dojo/query",
..
],
function(dom, Memory, domConstruct, query){
...
var container = dom.byId("chefDiv")
adresseStore = new Memory({data:data, idProperty: "myId"});
adresseStore.query().forEach(function(item, i){
addRow(item, container)
// do something with the index
});
JavaScript:
domConstruct.create("div",{...,class: "adresse",...}, container);
and it works fine
![[thumbsup] [thumbsup] [thumbsup]](/data/assets/smilies/thumbsup.gif)
HTML:
<div id="chefDiv">
<div class="adresse" ...>...</div>
<div class="adresse" ...>...</div>
</div>
Now, I want to open a window when one clicks on an "adresse" div - I add
JavaScript:
query(".adresse").on("click", function(){
// do stuff and open a window
}
![[2thumbsup] [2thumbsup] [2thumbsup]](/data/assets/smilies/2thumbsup.gif)
Great !!! how about adding a button that will hide non valid results ? let's go :
first add a
JavaScript:
query(".sltValide").on("click", function(){
domConstruct.empty("chefDiv");
adresseStore.query({validite:"V"}).forEach(function(item, i){
addRow(item, container)
// stuff with i
}); // foreach
}); // sltValide
HTML:
<div id="chefDiv">
<div class="adresse" ...>...</div>
<div class="adresse" ...>...</div>
</div>
![[bigcheeks] [bigcheeks] [bigcheeks]](/data/assets/smilies/bigcheeks.gif)
... that is, until I click on a div to open the window ...
![[sadeyes] [sadeyes] [sadeyes]](/data/assets/smilies/sadeyes.gif)
the
JavaScript:
query(".adresse").on("click", function()
because
JavaScript:
query(".adresse")
![[hairpull] [hairpull] [hairpull]](/data/assets/smilies/hairpull.gif)
anyone has a clue ?
![[orientalbow] [orientalbow] [orientalbow]](/data/assets/smilies/orientalbow.gif)
i'm stuck :-/