Author Topic: RequireJS: How to?  (Read 2465 times)

switchautomation

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 3
    • View Profile
RequireJS: How to?
« on: July 31, 2018, 03:52:02 pm »
Hi
How to load pqGrid over RequireJS?
There are some errors on loading in current version

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: RequireJS: How to?
« Reply #1 on: August 01, 2018, 01:30:03 pm »
You need to add shim for pqgrid ( in order to mention its dependencies ) in require.config

Code: [Select]
shim: {
  //more dependencies required e.g. jszip if you use Excel import / export feature of pqgrid.
  pqgrid: [ 'jquery', 'jquery-ui', .... ]
}

In your application:

Code: [Select]
define([ 'pqgrid' ], function() {
    //initialize pqgrid.
});
« Last Edit: August 01, 2018, 01:33:02 pm by paramquery »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: RequireJS: How to?
« Reply #2 on: August 01, 2018, 11:47:22 pm »
I tested it loading with requirejs, and I faced an error.

Thanks for reporting issue, it would be fixed in next version, hopefully by end of this month.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: RequireJS: How to?
« Reply #3 on: September 18, 2018, 01:06:22 pm »
This is fixed in v5.3.0