원준호
원준호

Reputation: 33

How to change hidden value after callback function in EtxJs

i have a prob about hiding grid and displaying error when value of success is false after callback function.

items:[
    {
        xtype:'textfield',
        text:'error',
        hidden:true
    }, 
    {
        xtype:'grid',
        store:networkDriveStore,
        hidden:false,

in below codes, networkGrid and networkError value return 'false or true' which means it is returning a hidden value.

var networkGrid=me.items.items[0].config.items[5].items[1].hidden;
var networkError=me.items.items[0].config.items[5].items[0].hidden;

and this below code is store.load!!

networkDriveStore.load({
    callback:function(records, response, operation){
        if(response.success == true){
        }
        else if(response.success == false){
            networkGrid=false;
            networkError=true;
        }
    }
}); 

networkGrid and networkError are actually changed false to true and true to false when response.success==false on Chrome DevTools. but doesn't work appearing on view.
how can i change the hidden value of networkGrid and networkError when response.success == false on view??

Thank you.

Upvotes: 0

Views: 96

Answers (1)

mcg1103
mcg1103

Reputation: 688

It appears you are changing the reference to the hidden value. This will not change the hidden value of a component.

You need to get the grid component and call the setHidden(false) method. hidden is a bindable property...

Here is a fiddle that I did to show how to bind properties.

Upvotes: 1

Related Questions