Grid won't bind / display data

6 posts, 0 answers
  1. Tycho
    Tycho avatar
    12 posts
    Member since:
    Dec 2011

    Posted 28 Jun 2012 Link to this post

    Hi all,

    I've got a grid that won't bind / display data. 

    var ds = new{
        type: "odata",
        transport: {
            read: {
                url: dataUrl,
                dataType: "jsonp",
                jsonp: "callback",
                jsonpCallback: 'DataCallBack'
        error: function (e) {
                alert("Error2: " + e);
        serverPaging: true,
        pageSize: 10

    Using firebug i can see a request is being made and the following data in JSONP format is returned by the service: 
    DataCallBack( [{"RunStatusTag":null,"Service":"Charge Pump","SiteName":"FCCU"},{"RunStatusTag":null,"Service":"Charge Pump 2","SiteName":"FCCU2"},{"RunStatusTag":null,"Service":"Charge Pump3","SiteName":"FCCU3"}] );

    The grid is defined as below, the databound event never fires:
        dataBound: function(e) {
             alert("Bound2 " + e);
        columns: [
                {   field:"SiteName",title: "Plant/Facility" },
                {   field:"Service",title: "Service"    }

    Any idea's? 
  2. Jerry T.
    Jerry T. avatar
    118 posts
    Member since:
    Jul 2012

    Posted 29 Jun 2012 Link to this post


    Have you tried defining a schema for the datasource? In your case, add this to the dataSource object (assuming "SiteName" is a key column):
    schema: {
    data: "d",
    model: {
    id: "SiteName",
    fields: {
    RunStatusTag: { nullable: true },
    Service: { type: "string" },
        SiteName: { type: "string" }
  3. Jesse
    Jesse avatar
    12 posts
    Member since:
    Jul 2012

    Posted 29 Jun 2012 Link to this post

    What are you using for your service specifically are you using the Web api, Wcf, or some other tehcnology?
  4. Tycho
    Tycho avatar
    12 posts
    Member since:
    Dec 2011

    Posted 30 Jun 2012 Link to this post

    @Jerry: i tried adding a schema before, but not exactly like the one you suggested. I tried yours but still the grid doesn't seem to bind. It doesn't give any errors either.

    @Jessy : WCF built in ASP.NET 3.5 running on IIS. It's returning the jsonp described above. I've pasted the request and answer headers that i using firebug below. 

    Answer headers soiurce:
    Cache-Control private
    Content-Encoding gzip
    Content-Length 1451
    Content-Type application/json; charset=utf-8
    Date Sat, 30 Jun 2012 19:38:01 GMT
    Server Microsoft-IIS/7.5
    Vary Accept-Encoding
    X-AspNet-Version 2.0.50727
    X-Powered-By ASP.NET

    Requist header source:
    Accept */*
    Accept-Encoding gzip, deflate
    Accept-Language nl,en-us;q=0.7,en;q=0.3
    Cache-Control max-age=0
    Connection keep-alive
    Host localhost:17592
    Referer http://server:9999/pages/pagename.aspx?TN=123&TB=&SD=21/Jun/2012%2003:15%20AM&ED=21/Jun/2012%2011:15%20AM&SI=e400e401-83c1-43e2-bb39-56f76521afab&Level=2&EqID=&EqTyp=All&EqNm=
    User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1

  5. Matt
    Matt avatar
    38 posts
    Member since:
    Nov 2014

    Posted 04 Jun 2015 Link to this post

    I think I'm having the same issue, but I'm just calling an MVC Controller method instead of a WCF service.  I've caught the call to the server in debug, so I know it's getting that far.  On my dataSource I've got it doing an alert on requestStart and requestEnd, and both of those are firing, but my grid is never firing its dataBound event either.
  6. Alexander Valchev
    Alexander Valchev avatar
    2873 posts

    Posted 09 Jun 2015 Link to this post

    Hi Matt,

    This thread is old and outdated, it was created in Jun 2012.

    Please open a new thread and provide a sample of the server JSON response so we can examine its structure and verify that the DataSource is configured correctly.

    Thank you in advance.

    Alexander Valchev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top