Populating a FilteringSelect datastore from an onChange event

前端 未结 2 1638
孤街浪徒
孤街浪徒 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

    0 讨论(0)
  • 2020-12-21 18:02

    Try console.log() in the event to see if it is launched. Changing the store should work, however for other widgets like grid you have also to call refreshing methods.

    0 讨论(0)
提交回复
热议问题