jQWidgets Forums

jQuery UI Widgets Forums General Discussions jqxGrid performance code check

This topic contains 0 replies, has 1 voice, and was last updated by  nanonerd 10 years, 3 months ago.

Viewing 1 post (of 1 total)
  • Author
  • jqxGrid performance code check #68377

    nanonerd
    Participant

    Hi,

    Our grid bind is slow. Yes, we have lots of data but still …

    Was wondering if you could get one of your jQuery/Javascript wizards to do a check on the following in your grid JS file wherever it’s doing the actual data bind. I tried to look myself but not sure how to find.

    Basically, I would like to confirm that if you are using for loops, that the selector is cached and not in the for loop itself. The former can provide a large performance gain over the latter because DOM interrogations are slow. The code change is subtle but I’m sure your JS wizard will see the difference.

    Grid.slowBind = function() {
       var i, val;
       for(i = 0; i < 50; i++){
          val = $('#gridBind').html();
       }
    }
    
    Grid.fastBind = function(){
       var i, val, $gridBind = $('#gridBind');    // Here, the selector is cached. 
       for(i = 0; i < 50; i++){
          val = $gridBind.html();
       }
    }
    

    Thank you.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.