Opened 11 years ago

Closed 10 years ago

Last modified 8 years ago

#9115 closed defect (fixed)

ComboBox should expose deep query option

Reported by: Phil Kaasa Owned by:
Priority: high Milestone: 1.4
Component: Dijit - Form Version: 1.3.0
Keywords: Cc:
Blocked By: Blocking:

Description

ComboBox? always sends deep:true to its data store. This query option should be exposed to users of ComboBox? the same way that the ignoreCase query options is exposed. Alternatively (and perhaps better), ComboBox? should simply expose the queryOptions attribute directly just like it exposes the query attribute.

Always setting deep:true was added in Changeset 9925 as the fix to ticket #3907.

Suppose I have data that looks like:

[
  {"name" : "Bob", "age" : 52, 
    "pet" : {"species" : "dog", "name" : "Fido"}
  },
  {"name" : "Ann", "age" : 36,
    "pet" : {"species" : "dog", "name" : "Argus"}
  },
  {"name" : "George", "age" : 40,
    "pet" : {"species" : "cat", "name" : "Booger"}
  },
  {"name" : "Sally", "age" : 45,
    "pet" : {"species" : "cat", "name" : "Belle"}
  },
]

With the current behavior, I have to either manipulate the data or hack the data store or ComboBox? to list only the people by name without also including all the pets' names. That is, if my search attribute is "name", the ComboBox? will have Bob, Fido, Ann, Argus, George, Booger, Sally, and Belle in it. There should be a non-hacky way to do a shallow query so the ComboBox? has only Bob, Ann, George, and Sally in it.

There is no good reason to only allow deep queries from a ComboBox?.

Change History (4)

comment:1 Changed 10 years ago by bill

You can control this already by overriding fetchProperties, can't you?

new dijit.form.ComboBox({
    fetchProperties: {
         queryOptions: {
             ignoreCase: true,
             deep: false
        }
   }
});

comment:2 Changed 10 years ago by Phil Kaasa

So you can.

Now if only that were documented somewhere...

Looks like this isn't strictly a bug.

comment:3 Changed 10 years ago by bill

Milestone: tbd1.4
Resolution: fixed
Status: newclosed

Updated the API documentation in [17383] to make this clearer.

comment:4 Changed 8 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.