Waiting to execute javascript once page is fully loaded in Sugar 7

I need to hide a button in record view depending on the status

The problem I have is that the page needs to be fully loaded before I run the javascript to hide it

How can I do this?

I tried $( document ).ready(function() { but that doesnt work

Any ideas will be gratefull received

Sugar 7 is beginning to seriously depress me :(




Parents
  • Thanks

    I tried :

    $(document).on('load', function() {alert(1)})         
    $(window).load(function() {alert(2)})

    neither are triggered :(

    I think I may need to use $.when( to check if page is loaded but can't work out how at the moment

    This is incredibly frustrating 

    Is it only me that is finding doing the simplest things in sugar 7 is really difficult?

    I asked someone from Sugar and was pointed to the Adding Field Validation document but that is worse than useless for what I'm trying todo



  • In the same boat... unfortunately. I went from feeling extremely comfortable to first-time training wheels.

    I wish there was a guide like:
    "if you used to do this in 6.5.x now do this in v7.x"
    at least for the most common things that we used to do in view.edit/detail/list.php and metadata files.

    Very very very slow progress on my end.
    FrancescaS
Reply Children
No Data