#11035 closed enhancement (wontfix)
FilteringSelect nested fields
Reported by: | Fausto Lemos | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | tbd |
Component: | Dijit - Form | Version: | 1.4.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
Hello!
i´m using a FilteringSelect and try to set my "searchAttr" with a nested field present on a JSON string. An error occurred and then i debug and see that "labelFunc()" doesn´t expect this situation. So a make a quick customization and want to share with you guys to discuss if its possible to put this enhancement at the next release:
labelFunc: function(_33,_34){ if (this.searchAttr.indexOf(".") != -1) { return dojo.getObject(this.searchAttr,false,_33.i).toString(); } else return _34.getValue(_33,this.searchAttr).toString(); }
Change History (5)
comment:1 follow-up: 2 Changed 11 years ago by
Description: | modified (diff) |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
comment:2 Changed 11 years ago by
Replying to bill:
Thanks for the idea. You must be using JsonRestStore? There's no concept of nested fields in dojo.data.
It's good that you found a way to do this for your case (which is probably a common case), and it's definitely OK to override that labelFunc method.
But, I don't want to add that code to FilteringSelect because FilteringSelect (like all the dijit widgets) is data-store agnostic, so it needs to work against any store, for which the official interface is:
store.getValue(item, this.searchAttr)(And, that's what the current code is doing.)
Hello Bill,
i´m using a ItemFileReadStore?. It´s a interesting feature to allow nested fields at "searchAttr". Can we talk about a alternative way?
comment:3 Changed 11 years ago by
Well, maybe an alternative is to enhance the store so that this works:
store.getValue(item, "foo.bar.zaz")
In that case Tree doesn't need to know that it's a "nested field".
comment:5 Changed 10 years ago by
Component: | Dijit → Dijit - Form |
---|
Thanks for the idea. You must be using JsonRestStore? There's no concept of nested fields in dojo.data.
It's good that you found a way to do this for your case (which is probably a common case), and it's definitely OK to override that labelFunc method.
But, I don't want to add that code to FilteringSelect because FilteringSelect (like all the dijit widgets) is data-store agnostic, so it needs to work against any store, for which the official interface is:
(And, that's what the current code is doing.)