私は奇妙な状況につまずいた。
Dojo AMD バージョンを使用します。1.9。dojo.connect は dojo.on に置き換えられます
これまでのところ、すべて問題ありません。ここで、Eventlistener (チェックボックスが選択されている) を EnhancedGrid の IndirectSelection プラグインに接続したいと考えています。dojo.on で解決策を検索しましたが、dojo.connect しか見つかりませんでした?!
あれは正しいですか?dojo.connect は一般的に dojo 1.9 で非推奨になったということですか?
これは私が道場側で見つけたコードです:
dojo.connect(grid.selection, 'onSelected'|'onDeselected', function(rowIndex){...})
ここに私のコードがあります:
if(!registry.byId("GraphGrid")){
grid = new EnhancedGrid({
id: 'GraphGrid',
store: GraphicStore,
query: { ident: "*" },
structure: layout,
rowSelector: '20px',
keepSelection: false,
plugins: {
indirectSelection: {
headerSelector:false,
width:"40px",
styles:"text-align: center;"
}}
},"GridGraphicInMap");
/*Call startup() to render the grid*/
grid.startup();
grid.on("rowClick", function(evt){
var idx = evt.rowIndex,
item = this.getItem(idx);
// get a value out of the item
var value = this.store.getValue(item, "geom");
highlightGeometry(value,true);
});
dojo.connect(grid.selection, 'onSelected', getSelectedItems);
}
else {
setTimeout(function(){
grid.setStore(GraphicStore);
}, 1000);
}...
dojo.on または grid.selection.on('Selected',getSelectedItems); に変更しようとしました。しかし、うまくいきません。この特殊なケースでも、dojo.connect は正しい接続方法ですか?
上記のコードは問題なく動作します。問題はありません。
よろしく、ミリアム