Opened 7 years ago
Last modified 4 years ago
#17704 new enhancement
dijit/form/_AutoCompleterMixin.js , method _announceOption , use lang.getObject in case of complex property
Reported by: | Herman Vierendeels | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | 1.15 |
Component: | Dijit | Version: | 1.9.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
if working with jpa, one can have complex types in returned items
e.g. [{"entityId":48,"entity":{"id":48,"name":"xxxx"},"id":131}]
In FilteringSelect? i can use : searchAttr:'entity.name'
But _AutoCompleterMixin can not handle this: TypeError?: item[this.searchAttr] is undefined
Could we use lang.getObject to get complex property from a dot-separated string?
e.g.
_announceOption: function(/*Node*/ node){ .... }else{ var item = this.dropDown.items[node.getAttribute("item")]; //tshvr4 TypeError: item[this.searchAttr] is undefined console.log('tshvr4 _AutoCompleterMixin searchAttr='+this.searchAttr); var searchAttrObj=lang.getObject(this.searchAttr,false,item);//tshvr4 console.log('tshvr4 _AutoCompleterMixin searchAttrObj='+searchAttrObj); newValue = (this.store._oldAPI ? // remove getValue() for 2.0 (old dojo.data API) //tshvr4 this.store.getValue(item, this.searchAttr) : item[this.searchAttr]).toString(); this.store.getValue(item, this.searchAttr) : searchAttrObj).toString();//tshvr4 this.set('item', item, false, newValue); } .... }
Change History (2)
comment:1 Changed 5 years ago by
Milestone: | tbd → 1.12 |
---|
comment:2 Changed 4 years ago by
Milestone: | 1.13 → 1.15 |
---|
Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.
Note: See
TracTickets for help on using
tickets.
Will consider for Dojo 1.12.