Pokazywanie postów oznaczonych etykietą Dojo Toolkit. Pokaż wszystkie posty
Pokazywanie postów oznaczonych etykietą Dojo Toolkit. Pokaż wszystkie posty

wtorek, 24 lipca 2012

Dojo Toolkit: Content of the first tab in dijit.layout.TabContainer is not displayed

dijit.layout.TabContainer
Dojo Toolkit 1.7.1

To fix this problem refresh the first tab by switching to the second and then to the first tab. See the code below:

var tabContainer = dijit.byId('tabContainerID'),
firstTab = dijit.byId('firstTabID'),
secondTab = dijit.byId('secondTabID');
 
tabContainer.selectChild(secondTab);
tabContainer.selectChild(firstTab);

poniedziałek, 27 lutego 2012

Dojo Toolkit: Refreshing store of dijit.form.ComboBox

dijit.form.ComboBox
Dojo Toolkit 1.7.1

It's impossible now to refresh a store of a combobox through assigning new store object to the "store" attribute. But you can use this simple solution:

var myComboBox = {};

function fReloadDataToComboBox()
{   

    if(myComboBox)
    {
        myComboBox.destroyRecursive(false);
    }

    var myStore = new dojo.data.ItemFileReadStore({
        url: "myService"
    });

    myComboBox = new dijit.form.ComboBox({
        id: "myComboBox",
        name: "my_name",
        store: myStore,
        searchAttr: "name",
        onChange: fOnChangeComboBox
    });

    dojo.place(myComboBox.domNode, dojo.byId("myDiv"));      
}