jQWidgets Forums

Forum Replies Created

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

  • DM
    Participant

    It is possible to use JSON.stringify if you use a censor function to strip out the properties that cause the circular reference.

    i.e.

    function censor(key, value) {
    	if(key.slice(0, 1) == "_") {
    		return undefined;
    	}
    	return value;
    }
    
    var layout = JSON.stringify($('#dockinglayout').jqxDockingLayout('saveLayout'), censor); // Generates a string representing the layout
    

    The layout can then be restored using

    $('#dockinglayout').jqxDockingLayout('loadLayout', JSON.parse(layout)); // Parses the string and restores the layout
    

    DM
    Participant

    Ok. I was trying to get it to drag the whole row rather than single cells but I can restrict it to the first cells of the rows and that seems to work. Thanks.


    DM
    Participant

    Yes, thanks..’auto’ is working nicely…


    DM
    Participant

    Hi Peter,

    So let’s assume that we’ve navigated to page 2, with a page size of 10 and therefore I get back an array of items with the indexes 10, 11, 12, 13, 14, 15, 16, 17, 18, 19. I then try to export this page and the export functionality eventually ends up in the exportContent function of jsqdata.export.js which has a for (;;) loop starting at 0 – and it fails. I’m guessing that if this was a forEach loop or started at the lowest array index, then it would work fine. My users would be able to export and print page n (I’m printing a grid by exporting to HTML and printing the output).

    At the end of the day, by the time the export code runs it’s already retrieved the data so that’s fine. It’s how the data is processed by the export that’s causing the error…

    function exportContent(exporter) {
    exporter.beginBody();
    for (var i = 0; i < data.length; i += 1) {
    exportRow(exporter, data[i], i);
    }
    exporter.endBody();
    }

    I think it's worth a look to see if it can be fixed. Otherwise I've got to disable printing and exporting for anything other than the first page.

    Regards,

    Alan Faux


    DM
    Participant

    Hi,

    Ok…a little confused. I understand there’s a virtual mode where requests for data are made as the user scrolls through the grid, but here we’re doing server side pagination. We’ve retrieved our records for page (n) and they’re in the grid. There’s no more data to retrieve.

    Isn’t there a difference between a virtual mode with pagination (server side pagination) and a virtual mode without? I can understand the issue with data requests on demand but when it’s paginated there are no data requests on demand…

    Thanks.


    DM
    Participant

    I hit this problem also but specifying the false parameter didn’t work. Tracing through the code I found the condition:

    if (apply == true || apply != undefined) {
    this.applyfilters();
    }

    where “apply” is the “false” argument specified in the ‘clearfilters’ call. If “apply” is false then it’s not undefined and it applies the filters anyway.

    I’ve worked round the problem it by passing “undefined”. i.e.

    $(‘#jqGrid’).jqxGrid(‘clearfilters’, undefined);

    and then forcing a refresh on the grid data afterwards.

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