Author Topic: jQuery 2.x compatibility  (Read 4293 times)

PetrChudoba

  • Newbie
  • *
  • Posts: 2
    • View Profile
jQuery 2.x compatibility
« on: November 18, 2015, 01:24:43 pm »
Hello,
I recently downloaded the paramQuery Pro Demo and I am facing an exception when using jQuery 2.1.4 on the demo site (json.htm). Actually this problem seems to be within all versions of jQuery 2.x.

This exception appears on code line (hscroll is undefined):
Code: [Select]
var d=parseInt(h.hscroll.option("cur_pos")Exception stacktrace:
Code: [Select]
pqgrid.min.js:267 Uncaught TypeError: Cannot read property 'option' of undefined
p.calcInitFinalH @pqgrid.min.js:267
p.refresh @pqgrid.min.js:279
a.refresh @pqgrid.min.js:138
a.refreshView @pqgrid.min.js:139
a._onDataAvailable @pqgrid.min.js:317
a.refreshDataAndView @pqgrid.min.js:140
a._create @pqgrid.min.js:285
(anonymous function) @jquery-ui.min.js:6
e.Widget._createWidget @jquery-ui.min.js:6
e.(anonymous function).(anonymous function) @jquery-ui.min.js:6
(anonymous function) @jquery-ui.min.js:6
n.extend.each @jquery.js:374
n.fn.n.each @jquery.js:139
e.fn.(anonymous function) @jquery-ui.min.js:6
(anonymous function) @json.htm:422
j @jquery.js:3099
k.fireWith @jquery.js:3211
n.extend.ready @jquery.js:3417
I @jquery.js:3433

I've tested the same on paramQuery 2 (the free one) and there was no exception thrown for jQuery 2.1.4.

Any ideas what am I doing wrong?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6260
    • View Profile
Re: jQuery 2.x compatibility
« Reply #1 on: November 18, 2015, 02:10:30 pm »
Thanks for reporting the issue.

It's incompatible with jQuery 2.x for now, it would be looked into for the next version.

PetrChudoba

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: jQuery 2.x compatibility
« Reply #2 on: November 18, 2015, 02:52:17 pm »
Thanks for reporting the issue.

It's incompatible with jQuery 2.x for now, it would be looked into for the next version.
Thank you for quick reply. Is there any approximate release of next version? Exact date not needed, something like 1 month / 6 months is enough, we need to decide whether to use your component or not. Using jQuery 2.x is mandatory for us.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6260
    • View Profile
Re: jQuery 2.x compatibility
« Reply #3 on: November 18, 2015, 09:59:53 pm »
ETA for next version is end of Dec 2015 / Jan 2016

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6260
    • View Profile
Re: jQuery 2.x compatibility
« Reply #4 on: December 21, 2015, 05:51:37 pm »
This is the patch for v3.2.0 with jQuery 2.x

The patch can also be loaded through external js file to be included just after pqgrid.min.js file

Code: [Select]
  window.pqPager = function( selector , options ){               
        var $p = $( selector ).pqPager( options ),
            p = $p.data('paramqueryPqPager') || $p.data('paramquery-pqPager');
        return p;
    }       
    window.pqScrollBar = function( selector , options ){
        var $s = $( selector ).pqScrollBar( options ),
            s = $s.data('paramqueryPqScrollBar') || $s.data('paramquery-pqScrollBar');
        return s;
    }
    pq.grid = function( selector , options ){
        var $g = $( selector ).pqGrid( options ),
            g = $g.data('paramqueryPqGrid') || $g.data('paramquery-pqGrid');
        return g;
    }

http://jsfiddle.net/4puwknp0/