Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
300
jQuery igGrid databind no data appears
posted

I am having some issues with getting data to display using the igGrid.  I am programming in asp.net and calling a webmethod that returns json object back to the javascript.

Here is my code.

function test_json() {
    simpleLoad('orderdetail.aspx/GetOrderTotal', { orderid: '40069' }, testjson_success);
    return false;
}

my webmethod

Public Shared Function GetOrderDetail(ByVal PostData)
        Dim outputObj As New Dictionary(Of String, String)

        Dim _orderLines As EmunWorks.Info.SalesOrderLinesTotalInfo()
        Dim _orderLinesDB As New EmunWorks.DataAccess.SalesOrderLinesDB
        _orderLines = _orderLinesDB.GetSalesOrderLineTotals("40069")

        Dim jsSerializer As System.Web.Script.Serialization.JavaScriptSerializer
        jsSerializer = New System.Web.Script.Serialization.JavaScriptSerializer()

        Dim sbOrder As New System.Text.StringBuilder()

        jsSerializer.Serialize(_orderLines(0), sbOrder)

        Dim json As String = sbOrder.ToString()
        Return json
    End Function

if data get is successful then this
function testjson_success(data) {

    $("#grid1").igGrid({
        autoGenerateColumns: false,
         columns: [
            { headerText: "Line Count", key: "lineCount", dataType: "number" },
            { headerText: "Qty Count", key: "qtyCount", dataType: "numbers" }
        ],
        dataSource: data,
        width: '500px'
    });

}

the data object returns this json response.

{"d":{"lineCount":"23","qtyCount":"56","extendedSum":"$5,000.16"}}

I have also tried this response, but no luck

"{"LineCount":23,"QtyCount":56,"ExtendedSum":5000.1600000000008}"

my web method is really a an object that i Serialize to json

object.LineCount

object.QtyCount

Any help would be greatly appreciated.

Sy

Parents Reply Children