[Dojo-interest] dijit.form.Select using store and query doesnt work as expected

karlry karl at prodentus.se
Wed Apr 7 05:03:42 EDT 2010


Hi Omer,
TestScenario:

<script type="text/javascript">
dojo.require("dijit.form.FilteringSelect");
    dojo.require("dijit.form.Select");
var taskTypesJSON = {
        identifier: 'typeID',
        label: 'name',
        items: [
                {name: 'Type 1', typeID: '1'},{name: 'Type 2', typeID:
'2'},{name: 'Type 3', typeID: '3'}
        ]
    };

var taskGroupsJSON = {
        identifier: 'groupID',
        label: 'name',
        items: [ {name: 'Group 0', groupID: '0', typeID: '1'},
           
                {name: 'Group 10', typeID: '1', groupID: '1010'},
                        {name: 'Group 11', typeID: '1', groupID: '1011'},
                   
                        {name: 'Group 12', typeID: '1', groupID: '1012'},
                   
                        {name: 'Group 15', typeID: '1', groupID: '1015'},
                   
                        {name: 'Group 26', typeID: '2', groupID: '1016'},
                   
                        {name: 'Group 27', typeID: '2', groupID: '1017'},
                   
                        {name: 'Group 38', typeID: '3', groupID: '1018'},
                   
                        {name: 'Group 39', typeID: '3', groupID: '1019'}
                        ]};

    function changeGroups(newTypeID) {
        console.debug(dijit.byId('group').attr('query'));
        dijit.byId('group').attr('query', {typeID: newTypeID});
        console.debug(dijit.byId('group').attr('query'));
    }
    </script>


<body class="tundra">
<div dojoType="dojo.data.ItemFileWriteStore" data="taskGroupsJSON"
jsId="groupsStore" onClick="changeGroups"></div>
<div dojoType="dojo.data.ItemFileWriteStore" data="taskTypesJSON"
jsId="typesStore"></div>
<div>
    <div dojoType="dijit.form.Select" id="type" store="typesStore"
onChange="changeGroups"></div>
    <div dojoType="dijit.form.Select" id="group" store="groupsStore"
query="{typeID: '1'}"></div>
</div>
</body>

Sorry for my ignorance but on what object do I call fetch()?

first time changing type it prints:
null
3

Thanks
-- 
View this message in context: http://n3.nabble.com/dijit-form-Select-using-store-and-query-doesnt-work-as-expected-tp699771p702479.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.


More information about the Dojo-interest mailing list