如何使用Dojo imageStore getValue

How to use Dojo imageStore getValue?

本文关键字:getValue imageStore Dojo 何使用      更新时间:2023-09-26

首先,我是一个Dojo新手。我刚刚花了半天时间试图从imageStore获取thumbnailpicker的值。我在谷歌遭遇了惨痛的失败。如果有人能帮助我,我将不胜感激。

这是我的不工作。

dijit.byId('thumbpicker').imageStore.getValue( 'dimensions');

在我的itemfilewritestore中有一个名为dimensions的键用于缩略图选择器。我可以从firebug中看出来。我只是不知道如何获得它与道场。我等不及要回到jQuery了:)

我从未使用过ThumbnailPicker,但我认为问题是商店的getValue方法需要两个参数:项目和您想要的值的名称。当您说:imageStore.getValue("dimensions")时,您想要的是商店中哪个项目的尺寸?假设您的项目在变量target中,您实际上必须这样做:

dijit.byId('thumbpicker').imageStore.getValue(target, 'dimensions');

实际上,从小部件获取属性的正确方法是使用get方法,因此

dijit.byId('thumbpicker').get("imageStore").getValue(target, 'dimensions');