jQuery UI Widgets Forums Grid Problem with StatusBar and Aggergates

This topic contains 7 replies, has 4 voices, and was last updated by  TP_DTNA 8 years, 12 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • Problem with StatusBar and Aggergates #13650

    DavidSimmons
    Participant

    In this example my status bar works great until I set showaggregates: true. Then my status bar disappears. Can you help me with this?

    $(jqxgrid).jqxGrid({
    theme: theme,
    width: ‘99.9%’,
    height: 300,
    source: dataAdapter,
    scrollbarsize: 10,
    sortable: true,
    sorttogglestates: 1,
    altrows: true,
    virtualmode: false,
    enablehover: false,
    enabletooltips: false,
    autoheight: false,
    autosavestate: false,
    autoloadstate: false,
    columnsresize: true,
    columnsreorder: false,
    editable: true,
    selectionmode: “singlecell”,
    filterable: true,
    showfilterrow: true,
    statusbarheight: 26,
    showstatusbar: true,
    showaggregates: true,
    renderstatusbar: function (statusbar) {
    var container = $(“

    “);

    var table = $(“”);
    table.appendTo(container);

    var tableRow = $(“”);
    tableRow.appendTo(table);

    var tableLeft = $(“”);
    tableLeft.appendTo(tableRow);

    var tableCenter = $(“”);
    tableCenter.appendTo(tableRow);

    var tableRight = $(“”);
    tableRight.appendTo(tableRow);

    var refreshButton = $(“

    “);
    refreshButton.find(‘span’).addClass(‘ui-icon ui-icon-refresh’);
    refreshButton.width(16);
    refreshButton.jqxTooltip({ content: ‘Refresh Grid!’, position: ‘mouse’, name: ‘Tooltip’, theme: theme });
    refreshButton.appendTo(tableLeft);

    var recalculateButton = $(“

    “);
    recalculateButton.find(‘span’).addClass(‘ui-icon ui-icon-arrowstop-1-n’);
    recalculateButton.width(16);
    recalculateButton.jqxTooltip({ content: ‘Recalculate!’, position: ‘mouse’, name: ‘Tooltip’, theme: theme });
    recalculateButton.appendTo(tableLeft);

    var pagingLabel = $(“

    “);
    pagingLabel.text(“Records”);
    pagingLabel.appendTo(tableCenter);

    statusbar.append(container);

    refreshButton.click(function (event) {
    $(jqxgrid).jqxGrid(‘updatebounddata’);
    });

    recalculateButton.click(function (event) {
    if(selectedID>0){
    $(“#message”).html(“Recalculate”);
    $.ajax({
    type: “POST”,
    url: “../Bid/BidRecaculateJSON.php”,
    data: { BidID: selectedID}
    }).done(function( msg ) {
    $(“#message”).html(“Transaction: ” + msg);
    $(jqxgrid).jqxGrid(‘updatebounddata’);
    });
    }else{
    $(“#message”).html(“You must select a Bid!”);
    }
    });
    },

    Problem with StatusBar and Aggergates #13660

    Peter Stoev
    Keymaster

    Hi David,

    The Grid’s Column Aggregates are displayed in the StatusBar area. You are not able to render custom widgets into that area in case you wish the built-in aggregates to be displayed.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Problem with StatusBar and Aggergates #13701

    DavidSimmons
    Participant

    Thanks…

    Problem with StatusBar and Aggergates #13702

    DavidSimmons
    Participant

    Do you plan to correct the issue with the Aggregator returning incorrect results when the column does not contain values for each row.

    Problem with StatusBar and Aggergates #13703

    Peter Stoev
    Keymaster

    Hi David,

    Please, provide a sample which demonstrates the new issue that you have.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Problem with StatusBar and Aggergates #15332

    Example:

    2 columns

    Product a = 10
    Product b = 0
    Product c = 10
    product d = 0
    product e = 0

    Aggregates ‘avg’ return 20/5 = 4 instead I need 20/2 = 10

    Is it possible?

    Marco

    Problem with StatusBar and Aggergates #15618

    anyone?

    Problem with StatusBar and Aggergates #80538

    TP_DTNA
    Participant

    Is it a solution to just implement a custom aggregate function, one that ignores rows you don’t want in the average?

    There’s a aggregate property in the column definition, looks like:

    aggregates: [‘count’, {
    ‘Cappuccino Items’: function (aggregatedValue, currentValue) {
    if (currentValue == “Cappuccino”) {
    return aggregatedValue + 1;
    }
    return aggregatedValue;
    }
    }]

    example seen here: http://jsfiddle.net/jqwidgets/3y7RN/

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

You must be logged in to reply to this topic.