Author Topic: Sometimes pqgrid donīt load localize file  (Read 3308 times)

dcalvo

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 7
    • View Profile
Sometimes pqgrid donīt load localize file
« on: September 04, 2015, 06:29:16 am »
Attach source code of web page where I use pqgrid and pq-localize-es.js, but spanish texts donīt show up (always show english messages). Instead, in other pages, thats works.

I donīt know what is wrong.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6265
    • View Profile
Re: Sometimes pqgrid donīt load localize file
« Reply #1 on: September 07, 2015, 01:33:31 pm »
Please ensure that the pqgrid.min.js file is loaded before and not after the below lines of code. If it's loaded after theses lines, it would reset the regional strings back to English.

$.extend($.paramquery.pqGrid.prototype.options, $.paramquery.pqGrid.regional[locale]);
$.extend($.paramquery.pqPager.prototype.options, $.paramquery.pqPager.regional[locale]);

Please share a reduced test case (exclude other unrelated code and scripts ) or a jsfiddle if still facing issues.
« Last Edit: September 07, 2015, 01:35:30 pm by paramquery »

dcalvo

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Sometimes pqgrid donīt load localize file
« Reply #2 on: September 07, 2015, 06:32:13 pm »
But it's what I 'm doing (see the follow lines of code)...

   <!--Archivos jQuery necesarios-->
   <script src="http://hrbs.motionminds.com.ar:8080/js/jquery.pqgrid.min.js"></script>   
   <script src="http://hrbs.motionminds.com.ar:8080/js/jquery-ui.min.js"></script>
   
   <!--Archivos para la grilla ParamQuery-->
   <link rel="stylesheet" href="http://hrbs.motionminds.com.ar:8080/css/pqgrid.min.css" />
   <!--Archivo para dar soporte al thema de jQuery-ui-->
   <link rel="stylesheet" href="http://hrbs.motionminds.com.ar:8080/css/pqgrid.ui.min.css" />
   <!--Soporte para bootstrap-->
   <link rel="stylesheet" href="http://hrbs.motionminds.com.ar:8080/css/pqgrid.bootstrap.min.css" />
   <script type="text/javascript" src="http://hrbs.motionminds.com.ar:8080/js/pqgrid.min.js" ></script>       
   
   <!--Tema Office para la grilla-->
   <link rel="stylesheet" class="link-override" href="http://hrbs.motionminds.com.ar:8080/css/pqgrid-office.css" type="text/css"/>
   
   <!--Archivo de idioma-->
   <script type="text/javascript" src="http://hrbs.motionminds.com.ar:8080/js/pq-localize-es.js" ></script>   
   
   <!--Include Touch Punch file to provide support for touch devices-->
   <!--<script type="text/javascript" src="http://hrbs.motionminds.com.ar:8080/js/touch-punch.min.js" ></script>-->

   <script type="text/javascript">
   //--Seteo de idioma de la grilla
   $.extend($.paramquery.pqGrid.prototype.options, $.paramquery.pqGrid.regional['es']);
   $.extend($.paramquery.pqPager.prototype.options, $.paramquery.pqPager.regional['es']);

   </script>
   
   <link rel="stylesheet" href="http://hrbs.motionminds.com.ar:8080/css/jquery-ui-calendar.css">
   <script src="http://hrbs.motionminds.com.ar:8080/js/jquery-ui-calendar.js"></script>
   <link rel="stylesheet" href="http://hrbs.motionminds.com.ar:8080/css/style-calendar.css">

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6265
    • View Profile
Re: Sometimes pqgrid donīt load localize file
« Reply #3 on: September 08, 2015, 03:03:03 pm »
Please put these lines inside document ready callback.

Code: [Select]
   $(function(){
     $.extend($.paramquery.pqGrid.prototype.options, $.paramquery.pqGrid.regional['es']);
     $.extend($.paramquery.pqPager.prototype.options, $.paramquery.pqPager.regional['es']);
   });

dcalvo

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Sometimes pqgrid donīt load localize file
« Reply #4 on: September 09, 2015, 06:34:11 am »
Itīs works!!! Thank you!!!