jQWidgets Forums

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts

  • Pablo
    Participant

    Thanks for your kindly answer Ivailo. I don’t need make a custom export, I just need export all the data loaded in the grid. I’m using pagination, because I have a lot a data to retrieve.Tried all the recommendations that you made about exportdata and his fourth parameter but only export the first page.
    Here’s my code.If you can tell me what is my mistake, I would really appreciate it

    Thanks a lot

    <link rel=”stylesheet” href=”jqwidgets/styles/jqx.base.css” type=”text/css” />
    <link rel=”stylesheet” href=”jqwidgets/styles/jqx.classic.css” type=”text/css” />
    <link rel=”stylesheet” href=”jqwidgets/styles/jqx.fresh.css” type=”text/css” />
    <script type=”text/javascript” src=”scripts/jquery-1.11.1.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.selection.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxgrid.filter.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxgrid.sort.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/jqxgrid.pager.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxdropdownlist.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxcheckbox.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxwindow.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxpanel.js”></script>
    <script type=”text/javascript” src=”scripts/demos.js”></script>
    <script type=”text/javascript” src=”scripts/generatedata.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxgrid.edit.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxgrid.columnsresize.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxgrid.columnsreorder.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxgrid.export.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxcombobox.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxinput.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxtoolbar.js”></script>
    <script type=”text/javascript” src=”jqwidgets/jqxdata.export.js”></script>
    <script type=”text/javascript”>
    $(document).ready(function () {
    // var data = generatedata(300);
    var theme = ‘classic’;
    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘OrderNum’, type: ‘string’ },
    { name: ‘DistName’, type: ‘string’ },
    { name: ‘TradeName’, type: ‘string’ },
    { name: ‘PartNumber’, type: ‘string’ },
    { name: ‘Serial’, type: ‘string’ },
    { name: ‘NombreServ’, type: ‘string’ },
    { name: ‘CourierName’, type: ‘string’ },
    { name: ‘AWB’, type: ‘string’ },
    { name: ‘nombre’, type: ‘string’ },
    { name: ‘DJAI’, type: ‘string’ },
    { name: ‘Notas’, type: ‘string’ },
    { name: ‘Fecha’, type: ‘string’ }

    ],

    cache: false,
    url: ‘data.php’,
    pager: function (pagenum, pagesize, oldpagenum) {
    // callback called when a page or page size is changed.
    },
    filter: function()
    {
    // update the grid and send a request to the server.
    $(“#jqxgrid”).jqxGrid(‘updatebounddata’, ‘filter’);
    },
    sort: function()
    {
    // update the grid and send a request to the server.
    $(“#jqxgrid”).jqxGrid(‘updatebounddata’, ‘sort’);
    },
    root: ‘Rows’,
    beforeprocessing: function (data) {
    if (data != null)
    {
    source.totalrecords = data[0].TotalRows;
    }
    },

    };
    var dataadapter = new $.jqx.dataAdapter(source,{
    loadError: function(xhr, status, error)
    {
    alert(error);
    }
    }
    );

    var exportInfo;

    var dataadapter = new $.jqx.dataAdapter(source);
    $(“#jqxgrid”).jqxGrid(
    {
    width: 1330,
    source: dataadapter,
    selectionmode: ‘multiplecellsextended’,
    showemptyrow: true,
    filterable: true,
    theme: theme,
    autoheight: true,
    virtualmode: true,
    pageable: true,
    sortable: true,
    pageable: true,
    altrows: true,
    columnsresize: true,
    columnsreorder: true,
    sorttogglestates: 1,
    pagesize: 15,
    pagesizeoptions: [’15’, ’20’, ’50’, ‘100’,’200′,’500′,’1000′],
    autoshowfiltericon: true,
    rendergridrows: function (obj) {
    return obj.data;
    },
    columns: [
    { text: ‘Orden’, datafield: ‘OrderNum’, width: 80 },
    { text: ‘Distribuidor’, datafield: ‘DistName’, width: 150 },
    { text: ‘Marca’, datafield: ‘TradeName’, width: 80 },
    { text: ‘Part Number’, datafield: ‘PartNumber’, width: 100 },
    { text: ‘Serial’, datafield: ‘Serial’, width: 100 },
    { text: ‘Servicio’, datafield: ‘NombreServ’, width: 80 },
    { text: ‘Courier’, datafield: ‘CourierName’, width: 80 },
    { text: ‘AWB’, datafield: ‘AWB’, width: 100 },
    { text: ‘Estado’, datafield: ‘nombre’, width: 110 },
    { text: ‘SIMI’, datafield: ‘DJAI’, width: 100 },
    { text: ‘Notas’, datafield: ‘Notas’, width: 200 },
    { text: ‘Fecha’, datafield: ‘Fecha’, width: 170 }
    ]
    });
    $(‘#events’).jqxPanel({ width: 300, height: 80});
    $(“#jqxgrid”).on(“filter”, function (event) {
    $(“#events”).jqxPanel(‘clearcontent’);
    var filterinfo = $(“#jqxgrid”).jqxGrid(‘getfilterinformation’);
    var eventData = “Triggered ‘filter’ event”;
    for (i = 0; i < filterinfo.length; i++) {
    var eventData = “Filter Column: ” + filterinfo[i].filtercolumntext;
    $(‘#events’).jqxPanel(‘prepend’, ‘<div style=”margin-top: 5px;”>’ + eventData + ‘</div>’);
    }
    });
    $(‘#clearfilteringbutton’).jqxButton({ height: 25});
    $(‘#filterbackground’).jqxCheckBox({ checked: true, height: 25});
    $(‘#filtericons’).jqxCheckBox({ checked: false, height: 25});
    // clear the filtering.
    $(‘#clearfilteringbutton’).click(function () {
    $(“#jqxgrid”).jqxGrid(‘clearfilters’);
    });
    // show/hide filter background
    $(‘#filterbackground’).on(‘change’, function (event) {
    $(“#jqxgrid”).jqxGrid({ showfiltercolumnbackground: event.args.checked });
    });
    // show/hide filter icons
    $(‘#filtericons’).on(‘change’, function (event) {
    $(“#jqxgrid”).jqxGrid({ autoshowfiltericon: !event.args.checked });
    });

    $(“#excelExport”).click(function () {
    exportInfo = $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘xls’, ‘jqxGrid’, true, null);
    });
    $(“#csvExport”).click(function () {
    $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘csv’, ‘jqwGrid’, true, null);
    });

    });
    </script>


    Pablo
    Participant

    Hi
    Im having the same problem.I am using jqgrid with pagination.Virtualmode was set to true, and the fourth expordata parameter was set to null.However I can´t export all data.Just export the first page.Do i have to check another parameter?
    Thanks!

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