Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Vladimir Knobel 95 posts 171 karma points
    Nov 29, 2017 @ 20:02
    Vladimir Knobel
    0

    ClientDependency Framework & grid view

    Hi

    I'm trying to use the ClientDependency inside the view of a grid component but when @Html.Raw(Html.RenderJsHere()) is called all other scripts in the base template are rendered but the ones assigned inside the grid view are not.

    Does anyone knows a way to make ClientDependency works with grid views?

    My code inside the view is:

        Html.RequiresJs("~/scripts/jquery-ui-1.8.5.custom.min.js", 60);
    

    And the render takes place in a partial view:

    @Html.Raw(Html.RenderJsHere())
    
  • David Peck 687 posts 1863 karma points c-trib
    Nov 29, 2017 @ 20:52
    David Peck
    0

    You presumably only want to have a single location where the JS is rendered. Probably that is just before your closing </body> tag.

    I'd add all the Html.RequiresJs you need in the Grid but leave the JS rendering till later. If you really need to render out in two different places then check out Forced Providers.

  • Vladimir Knobel 95 posts 171 karma points
    Nov 29, 2017 @ 21:00
    Vladimir Knobel
    0

    Hi David

    That's exactly what I'm doing, sorry for not being more clear.
    What I have just noticed is that when running it locally in iis express it correctly renders the script files assigned in the grid view.

    Now when deployed to Azure it stops working...

    Any hint is highly appreciated.

    Thanks

  • David Peck 687 posts 1863 karma points c-trib
    Nov 29, 2017 @ 22:22
    David Peck
    100

    Are you doing caching? I've had issues with @Html.CachedPartial(). Because it just renders the cached output (second time around) and Html.RequireJs() never gets called.

  • Vladimir Knobel 95 posts 171 karma points
    Nov 30, 2017 @ 00:58
    Vladimir Knobel
    0

    Finally I found the problem and you are right. I'm using Donut Cache and LeBlender for the grid.
    It seems like LeBlender doesn't support very well Donut caching.
    I'll would need to do more work on this...

    Thank you very much for all the hints!

Please Sign in or register to post replies

Write your reply to:

Draft