[英]How to use Dojo imageStore getValue?
First off, Im a total Dojo newb.首先,我是一个总 Dojo newb。 I just burned half a day trying to get a value from an imageStore for a thumbnailpicker.
我刚刚花了半天时间试图从 imageStore 中获取缩略图选择器的值。 I have failed miserably at google.
我在谷歌惨败。 If anyone could help me, Id be greatly appreciative.
如果有人可以帮助我,我将不胜感激。
Heres what I have that doesnt work.继承人我有什么不起作用。
dijit.byId('thumbpicker').imageStore.getValue( 'dimensions');
There is a key called dimensions in my itemfilewritestore for the thumbnailpicker.在我的 itemfilewritestore 中有一个名为 dimensions 的键,用于缩略图选择器。 I can see it in firebug.
我可以在萤火虫中看到它。 I just have no clue how to obtain it with dojo.
我只是不知道如何使用 dojo 获得它。 I cannot wait to get back to jQuery:)
我迫不及待地想回到 jQuery :)
Thanks in advance.提前致谢。
I've never used the ThumbnailPicker, but I think the problem is that the store's getValue
method requires two arguments: the item and the name of the value you want.我从来没有用过ThumbnailPicker,但我认为问题在于商店的
getValue
方法需要两个arguments:项目和你想要的值的名称。 When you say: imageStore.getValue("dimensions")
, the dimensions for which item in the store is it that you want?当您说:
imageStore.getValue("dimensions")
时,您想要商店中哪个商品的尺寸? Assuming you have the item in a variable target
, you actually have to do:假设你有一个变量
target
中的项目,你实际上必须这样做:
dijit.byId('thumbpicker').imageStore.getValue(target, 'dimensions');
Actually, the right way to get a property from a widget is to use the get
method, so实际上,从小部件中获取属性的正确方法是使用
get
方法,所以
dijit.byId('thumbpicker').get("imageStore").getValue(target, 'dimensions');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.