jQWidgets Forums

Forum Replies Created

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

  • pja1
    Participant

    I wonder if this is a bug in jqxGrid (albeit one not introduced by you guys)?


    pja1
    Participant

    We have also found that having Firebug open can cause grid updates to take a long time.


    pja1
    Participant

    Thanks for the reply. That worked brilliantly. 600+ records updated and refreshed in under 1 second. We also used this technique to speed up the initial display of the grid when retrieving records from the server.

    We changed viewModel.updateExportToXero to be
    viewModel.updateExportToXero = function () {
    dataAdapter.beginUpdate();
    ko.utils.arrayForEach(this.items(), function (item) {
    item.ExportToXero(true);
    }
    dataAdapter.endUpdate();
    }

    FYI, the code I put in the initial post was an untested cut down version of what we are actually using. I noticed that I hadn’t declared the dataadapter in the above code, which I thought I’d correct here for the benefit of anyone else looking at this who is new to jq Widgets.

    viewModel.updateExportToXero = function () {
    ko.utils.arrayForEach(this.items(), function (item) {
    item.ExportToXero(true);
    }
    }

    viewModel.createJqxGrid = function () {

    var dataSourceInvoices = {
    localdata: viewModel.items,
    datafields: [
    { name: ‘ExportToXero’ },
    { name: ‘OkToExport’ },
    { name: ‘InvoiceNumber’ },
    ],
    datatype: ‘observablearray’
    }

    var invoiceColumns = [
    { text: ‘Export’, dataField: ‘ExportToXero’, editable: true, width: 50, columntype: ‘checkbox’},
    { text: ‘Invoice#’, dataField: ‘InvoiceNumber’, editable: false, width: 80},
    { text: ‘Date’, dataField: ‘InvoiceDate’, editable: false, cellsformat: ‘d’, width: 100 },
    ];

    var dataAdapter = new $.jqx.dataAdapter(dataSourceInvoices);

    $(‘#jqxgrid’).jqxGrid({
    source: dataAdapter,
    width: ’100%’,
    columns: gridColumns,
    height: 500,
    theme: ‘ui-redmond’,
    editable: true,
    sortable: true,
    columnsresize: true,
    showaggregates: true,
    showstatusbar: true,
    statusbarheight: 30,
    selectionmode: ‘singlerow’
    });
    }

    viewModel.updateExportToXero = function () {
    dataAdapter.beginUpdate();
    ko.utils.arrayForEach(this.items(), function (item) {
    item.ExportToXero(true);
    }
    dataAdapter.endUpdate();
    }

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