jQuery UI Widgets Forums Grid Localization do not work

This topic contains 1 reply, has 2 voices, and was last updated by  ivailo 8 years, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Localization do not work #73357

    fsigu
    Participant

    Hi i try to change the language to spanish, but the localization example do not work, i see this

    But it do not work for my grid with filter and php, my code is this.

    <!DOCTYPE html>
    <html lang=”en”>
    <head>
    <link rel=”stylesheet” href=”jqwidgets/styles/jqx.base.css” type=”text/css” />
    <link rel=”stylesheet” href=”jqwidgets/styles/jqx.classic.css” type=”text/css” />
    <script type=”text/javascript” src=”scripts/jquery-1.11.2.min.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxcore.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxbuttons.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxscrollbar.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxmenu.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxgrid.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxgrid.pager.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxgrid.selection.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxgrid.filter.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxdata.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxlistbox.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxdropdownlist.js”></script>
    <script type=”text/javascript”>
    $(document).ready(function () {

    var imagerenderer = function (row, datafield, value) {
    var src = value;
    return ‘‘;
    }

    var imagerendererpdf = function (row, datafield, value) {
    var src = value;
    return ‘‘;
    }

    // preparamos los datos
    var theme = ‘orange’;
    var source =
    {
    datatype: “json”,
    datafields:
    [
    { name: ‘fecha_emision’, type: ‘date’},
    { name: ‘numero_comprobante’, type: ‘string’},
    { name: ‘tipo_comprobante’, type: ‘string’},
    { name: ‘estado_sri’, type: ‘string’},
    { name: ‘autorizacion’, type: ‘string’},
    { name: ‘clave_acceso’, type: ‘string’},
    { name: ‘archivo_xml’, type: ‘string’},
    { name: ‘archivo_pdf’, type: ‘string’}
    ],
    url: ‘lista_comprobantes_data.php’,
    filter: function () {
    // actualizamos la grilla enviando la solicitod al server
    $(“#jqxgrid”).jqxGrid(‘updatebounddata’, ‘filter’);
    }
    };
    var dataAdapter = new $.jqx.dataAdapter(source);
    // inicio jqxGrid
    $(“#jqxgrid”).jqxGrid(
    {
    width: 800,
    source: dataAdapter,
    theme: theme,
    filterable: true,
    columns:
    [
    { text: ‘Fecha Emision’, datafield: ‘fecha_emision’,cellsformat: ‘dd/MM/yyyy’, width: 120 },
    { text: ‘Numero Comprobante’, datafield: ‘numero_comprobante’, width: 160 },
    { text: ‘Tipo Comprobante’, datafield: ‘tipo_comprobante’, width: 140 },
    { text: ‘Estado’, datafield: ‘estado_sri’, width: 100 },
    { text: ‘Numero de Autorizacion’, datafield: ‘autorizacion’, width: 350 },
    { text: ‘Clave de Acceso’, datafield: ‘clave_acceso’, width: 420 },
    { text: ‘Xml’, datafield: ‘archivo_xml’, width: 40 , cellsrenderer: imagerenderer},
    { text: ‘Pdf’, datafield: ‘archivo_pdf’, width: 40 , cellsrenderer: imagerendererpdf}
    ]
    });

    var localizationobj = {};
    localizationobj.percentsymbol= “%”;
    localizationobj.currencysymbol= “$”;
    localizationobj.currencysymbolposition= “anterior”;
    localizationobj.decimalseparator= “.”;
    localizationobj.thousandsseparator= “,”;
    localizationobj.pagergotopagestring= “Ir a pag=”;
    localizationobj.pagershowrowsstring= “Mostrar filas=”;
    localizationobj.pagerrangestring= ” de “;
    localizationobj.pagerpreviousbuttonstring= “previo”;
    localizationobj.pagernextbuttonstring= “siguiente”;
    localizationobj.groupsheaderstring= “Arrastre una columna para que se agrupe por ella”;
    localizationobj.sortascendingstring= “Ordenar Acs”;
    localizationobj.sortdescendingstring= “Ordenar Des”;
    localizationobj.sortremovestring= “Quitar orden”;
    localizationobj.groupbystring= “Agrupar por esta columna”;
    localizationobj.groupremovestring= “Quitar de grupos”;
    localizationobj.filterclearstring= “Limpiar”;
    localizationobj.filterstring= “Filtro”;
    localizationobj.filtershowrowstring= “Mostrar filas donde=”;
    localizationobj.filtershowrowdatestring= “Mostrar filas donde fecha=”;
    localizationobj.filterorconditionstring= “O”;
    localizationobj.filterandconditionstring= “Y”;
    localizationobj.filterselectallstring= “(Seleccionar Todo)”;
    localizationobj.filterchoosestring= “Por favor seleccione:”;
    localizationobj.filterstringcomparisonoperators= [‘vacio’, ‘no vacio’, ‘contenga’, ‘contenga(coicidir Mayusculas/Minusculas)’,
    ‘no contenga’, ‘no contenga(coincidir Mayusculas/Minusculas)’, ‘inicia con’, ‘inicia con(coicidir Mayusculas/Minusculas)’,
    ‘termina con’, ‘termina con(coicidir Mayusculas/Minusculas)’, ‘igual’, ‘igual(coicidir Mayusculas/Minusculas)’, ‘null’, ‘no null’];
    localizationobj.filternumericcomparisonoperators= [‘=’, ‘!=’, ‘<‘, ‘<=’, ‘>’, ‘>=’, ‘null’, ‘no null’];
    localizationobj.filterdatecomparisonoperators= [‘=’, ‘!=’, ‘<‘, ‘<=’, ‘>’, ‘>=’, ‘null’, ‘no null’];
    localizationobj.filterbooleancomparisonoperators= [‘=’, ‘!=’];
    localizationobj.validationstring= “Valor no valido”;
    localizationobj.emptydatastring= “No hay registros que mostrar”;
    localizationobj.filterselectstring= “Seleccione un Filtro”;
    localizationobj.loadtext= “Cargando…”;
    localizationobj.clearstring= “Limpiar”;
    localizationobj.todaystring= “hoy”;

    var days = {
    // full day names
    names: [“Domingo”, “Lunes”, “Martes”, “Miercoles”, “Jueves”, “Viernes”, “Sabado”],
    // abbreviated day names
    namesAbbr: [“Dom”, “Lun”, “Mar”, “Mie”, “Jue”, “Vie”, “Sab”],
    // shortest day names
    namesShort: [“Do”, “Lu”, “Ma”, “Mi”, “Ju”, “Vi”, “Sa”]
    };
    localizationobj.days = days;
    var months = {
    // full month names (13 months for lunar calendards — 13th month should be “” if not lunar)
    names: [“Enero”, “Febrero”, “Marzo”, “Abril”, “Mayo”, “Junio”, “Julio”, “Augosto”, “Septiembre”, “Octubre”, “Noviembre”, “Diciembre”, “”],
    // abbreviated month names
    namesAbbr: [“Ene”, “Feb”, “Mar”, “Abr”, “May”, “Jun”, “Jul”, “Ago”, “Sep”, “Oct”, “Nov”, “Dic”, “”]
    };
    localizationobj.months = months;

    // apply localization.
    $(“#jqxgrid”).jqxGrid(‘localizestrings’, localizationobj);

    });
    </script>
    </head>
    <body class=’default’>
    <center>

    <div id=”main”>
    Salir</div>
    <div id=”jqxgrid”></div>
    </center>
    </body>
    </html>

    Any idea where is the problem?
    Tanks

    Localization do not work #73367

    ivailo
    Participant

    Hi fsigu,

    Your php request maybe is slowing the data binding and the localizestrings method is waiting to be completed.
    This can be produced cause loading of a lot data, slower connection, wrong path to the php, etc.

    So to prevent this behavior you can add the localization in your ready callback.

    ...
     filterable: true,
     ready: function()
                {
                    $("#jqxgrid").jqxGrid('localizestrings', localizationobj);   
                },
     columns:
    ...

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.