hi
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 ...
the
never fires
because
doesn't return anything
anyone has a clue ?
i'm stuck :-/
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 - i've got something like
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
}
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>
... that is, until I click on a div to open the window ...
the
JavaScript:
query(".adresse").on("click", function()
because
JavaScript:
query(".adresse")
anyone has a clue ?
i'm stuck :-/