0

When the page loads, I want to hide some buttons based on user permissions.

I have a function that does what I need, but currently I have to press a button to call it.

How to run a applyUserPermissions function right after page loads using SmartClient?

function applyUserPermissions(){
    btn.setDisabled(false);
}
Tadija Bagarić
  • 2,495
  • 2
  • 31
  • 48

1 Answers1

0

Same as in plain Javascript

The statements are executed, one by one, in the same order as they are written.

~ w3c Javascript School

So like this:

<script>

function applyUserPermissions(){
    btn.setDisabled(false);
}

// calls it on page load
applyUserPermissions();

</script>
Community
  • 1
  • 1
Tadija Bagarić
  • 2,495
  • 2
  • 31
  • 48