Populating a FilteringSelect datastore from an onChange event

前端 未结 2 1642
孤街浪徒
孤街浪徒 2020-12-21 17:20

I\'m trying to bind an onChange event of one FilteringSelect to populate another FilteringSelect.

// View
dojo.addOnL         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-21 17:49

    I couldn't believe this was causing the problem, but the whole issue boiled down to the fact that it appears that a dojo ItemFileReadStore REQUIRES the label property of the JSON to be "name". In the end this is all that it required to wire them together.

    dojo.addOnLoad(function () {
    
        dijit.byId('filtering_select_2').store = new dojo.data.ItemFileReadStore({url: '/site/url'});
    
        dojo.connect(dijit.byId('filtering_select_1'), 'onChange', function (val) {
            dijit.byId('filtering_select_2').query.property_1 = val || "*";
        });
    });
    

    UPDATE: The property within Zend form has been fixed as of ZF 1.8.4

提交回复
热议问题