jQWidgets Forums

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: aggregates in dynamic columns aggregates in dynamic columns #42824

    Sethu
    Participant

    The actual error is “Function expected”

    in reply to: aggregates in dynamic columns aggregates in dynamic columns #42800

    Sethu
    Participant

    Peter,
    We tried the above approach, but below line from jqxgrid.aggregates.js is throwing “Function not found” error.
    {var c=d.aggregatesrenderer(g[d.datafield],d,b,this.getcolumnaggregateddata(d.datafield,g[d.datafield]));b.html(c)}}

    in reply to: aggregates in dynamic columns aggregates in dynamic columns #42353

    Sethu
    Participant

    Peter,
    Any updated on my question?

    in reply to: aggregates in dynamic columns aggregates in dynamic columns #33163

    Sethu
    Participant

    How do I return a return a function from webservice and not a string that’s JSON compatible

    in reply to: aggregates in dynamic columns aggregates in dynamic columns #33109

    Sethu
    Participant

    Peter,
    Sure. Below is the code:
    var columnsSource = {
    datatype: ‘json’,
    datafields: ”,
    type: ‘GET’,
    url: ‘Service.asmx/GetColumns’,
    async: false
    };

    var gridColumns = “”;
    var columnsDataAdapter = new $.jqx.dataAdapter(columnsSource, {
    contentType: ‘application/json; charset=utf-8’,
    loadError: function (xhr, status, error) {
    alert(error);
    },
    downloadComplete: function (data) {
    var returnData = {};
    var obj = data.d;

    returnData.records = “[{ text: ‘ID’, dataField: ‘ID’, width: 250 }]”;

    gridColumns = data.d;
    // return returnData;
    }
    });
    columnsDataAdapter.dataBind();
    $(“#jqxgrid”).jqxGrid({
    width: ‘100%’,
    height: ‘100%’,
    theme: theme,
    source: dataAdapter,
    altrows: true,
    editable: true,
    columnsresize: true,
    columnsreorder: true,
    showstatusbar: true,
    showaggregates: true,
    showtoolbar: true,
    autoheight: false,
    columns: [
    { text: ‘ID’, dataField: ‘ID’, width: 250 }
    ],

    });

    $(“#jqxgrid”).jqxGrid({ columns: gridColumns });

    The code from ASP.NET Service is below:
    [WebMethod]
    [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
    public object GetColumns()
    {
    var data = @”[
    { text: ‘ID’, dataField: ‘ID’, width: 250 },
    { text: ‘MATCH STATUS’, dataField: ‘MATCH_STATUS’, editable:false, width: 150, aggregates: [‘count’] },
    { text: ‘EXCEPTION DATE’, dataField: ‘EXCEPTION_DATE’, editable:false, width: 180, columntype: ‘datetime’, format: ‘MM/dd/yyyy’ },
    { text: ‘KEY ID’, dataField: ‘KEY_ID’, width: 180,editable:false, cellsalign: ‘right’, cellsformat: ‘c2’, aggregates: [‘sum’],
    aggregatesrenderer: “”function (aggregates) {
    return aggregates[sum];
    }””
    },
    { text: ‘CLIENT TOKEN’, dataField: ‘CLIENT_TOKEN’, width: 80, editable:false },
    { text: ‘APPROVED’, dataField: ‘APPROVED’, columntype: ‘checkbox’, width: 125, editable:true },
    { text: ‘Selected’, dataField: ”, columntype: ‘checkbox’, width: 125, editable:true }
    ]”;

    return new JavaScriptSerializer().DeserializeObject(data);

    //return data;
    }

    At $(“#jqxgrid”).jqxGrid({ columns: gridColumns }) line I am gettings aggregatesrenderer expects function error.

    in reply to: aggregates in dynamic columns aggregates in dynamic columns #33093

    Sethu
    Participant

    Peter,
    Thank you for your response. But by columns are being created dynamically and I creating it using the approach you specified in this blog. http://www.jqwidgets.com/community/reply/reply-to-dynamic-columns-in-grid-8/.
    Because my columns have aggregates renderer Javascript jqxGrid is throwing error.

    Thank you.

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