Login Register

query

dojo.data stores: How to use regexp queries to get result set?

I have a items in a data store that have a position object. For an array of items in the store, here's a sampling of the position attributes that the items might have:

position : 1
position : 1.1
position : 1.15
position : 1.15.1
position : 1.2.7
position : 2
position : 2.1

While it's easy enough to issue a query to the store for all position 1 items, such as query:{position:'1'}
- returns example 1 above

and it's pretty easy to issue a query for all level 1 items, such as query:{position:'?'}
- returns example 1 and 6 above

Dojo query instruments data structure

Hi,

Passing a json variable to the store and performing a query on it, changes the original data structure. It appears that dojo while creating a result set for a data store, instruments the original data structure passed into the store. Now that original data structure is changed for dojo's purposes and is no longer usable in it's original form, by the application.

If this is true I am going to write a bug, since the original data structure should be cloned and not acted upon directly.

Is there a way to get multiple query items into dojo.query?

I want to select a node that has two classes in it. Like dojo.query(".dndItemOver, .dndItemAnchor") is this possible or is it only one arg? Tried a couple ways and can't find any examples on multiple queries except in stores.

passing parameters in contentpane's href

I have a tabcontainer with a contentpane, let's call it editTab. Elsewhere I have a js function:

function modify(id) {
var editTab = dijit.byId("editTab");
submitTab.setHref="/edit.html?id=" + id;
submitTab.refresh();
dijit.byId("myTabContainer").selectChild(editTab);
}

Let's I call modify(42); On server side I get the request for edit.html, but with an empty querystring (you know, HttpServletRequest.getQueryString();). Does dojo eat away my parameters? Any way to go by this? Other than xhrPost and setContent?

I'm looking for suggestions on a better way to iterate through my dojo.data store to decrease # of iterations

Sorry that's a pretty vague subject. What I have is a store of items like this:

items: 
[
  { name: "button", category: "core", imageSrc: "image.png", label: "Button", description: "It's a button!" }, 
  and repeat...
]

How to query a dojo.data Store for items within a number range

Hello,

I have been experimenting with the dojo.data.ItemFileReadStore and find this very promising. Specialy the way to query items that match a certain string like "Fo*" is great. But I fear the most obvious is missing, isnt it?

Can I query for items that are within a certain number (int or float) range? Like I would sql "select * from countries where population < 300".

Is that possible somehow? Perhaps by sorting and then cutting off after the value get smaller?

Please suggest what you would find a good practice,
thank you for your help

dT

Syndicate content