Skip to content

Replies

0
Charles Craven-Bartl
Charles Craven-Bartl answered on Jan 23, 2017 10:55 AM

Actually, this still doesn't work as it seems that the hidden property is only referenced when the grid is initialised.  If another user is selected which changes the hideSpendLimit value this is not being picked up and evaluated by the column hidden property at run time.  

Any ideas any one?

 

0
Charles Craven-Bartl
Charles Craven-Bartl answered on Jan 23, 2017 9:56 AM

I don't know why I didn't think of this first: I just set up a boolean variable for each column that may be hidden and set the grid column hidden property to evaluate that variable value:

var hideSpendLimit = false;

if (user.isAuthoriser === true){

hideSpendLimit = false;

} else {

hideSpendLimit = true;

}

,{
key: 'SpendLimit',
dataType: 'number',
headerText: 'Spend Limit',
hidden: hideSpendLimit
}