Opened 8 years ago

Last modified 5 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:


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:''

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?


_announceOption: function(/*Node*/ node){

				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 = ( ? // remove getValue() for 2.0 (old API)
					//tshvr4, this.searchAttr) : item[this.searchAttr]).toString();, this.searchAttr) : searchAttrObj).toString();//tshvr4
				this.set('item', item, false, newValue);



Change History (2)

comment:1 Changed 6 years ago by dylan

Milestone: tbd1.12

Will consider for Dojo 1.12.

comment:2 Changed 5 years ago by dylan

Milestone: 1.131.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.