1

I have the following app on my org:

http://blogforce9dev-developer-edition.ap1.force.com/ProjectDetail?id=a0290000009M3zR

It basically just enhances page block tables, however I can't get jQuery to play nicely with it. I have the following jQuery:

<script type="text/javascript">
    var $j = jQuery.noConflict();
    $j(document).ready(function() {
        $j('input').ready(function(){
            $j('input').spinner();
        });
    });
</script>

That works fine on a normal input field on a normal PageBlockTable, but doesn't when the above app is used to change the page block table.

The ID in the final source is the same, so I can't figure out what's happening. Has anybody else experienced this or similar and can share some insight into what might be happening?

Thanks.

  • 2
    That component pulls in quite a lot of JavaScript (github.com/Avinava/PageBlockTableEnhancerADV/blob/master/src/…) including jQuery 2.0.x. I suggest you add your own JavaScript apex:includeScript immediately before the code you quote in your question to make sure the required version is in scope when your JavaScript runs. – Keith C Oct 13 '15 at 14:12
  • Thanks for your help Keith. I added an apex:includeScript tag for jQuery ui before my code and it worked flawlessly. – user24634 Oct 13 '15 at 14:26
3

That component pulls in quite a lot of JavaScript (https://github.com/Avinava/PageBlockTableEnhancerADV/blob/master/src/components/PageBlockTableEnhancerADV.component) including jQuery 2.0.x. I suggest you add your own JavaScript apex:includeScript immediately before the code you quote in your question to make sure the required version is in scope when your JavaScript runs.

(The explanation here is that as soon as jQuery is included in a page the symbols jQuery and $ get set to that specific version. So when jQuery is included multiple times the version in scope can vary. Placing your own apex:includeScript immediately before your jQuery dependent code at least ensures that the version is appropriate for your code.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy