When no rows (XML response body is null) DataSource goes into a coma ?

2 posts, 0 answers
  1. RichardAD
    RichardAD avatar
    105 posts
    Member since:
    Feb 2012

    Posted 17 Mar 2012 Link to this post

    I have a grid hooked up to a XML fed DataSource.
    For the case of 'no rows' returned the response body is null/blank
    When the data source encounters this response, it goes to 'lala' land and does not respond properly when read is requested again

    See
    http://devenezia.com/kendo/zeroRowsProblem.html

    What are some grid/datasource strategies for dealing with no data conditions ?

    Thanks,
    Richard

  2. RichardAD
    RichardAD avatar
    105 posts
    Member since:
    Feb 2012

    Posted 21 Mar 2012 Link to this post

    Anyone ?

    After much stepping and stopping I was able to get a preliminary solution.

    Modified Beta v2012.1.229 as follows:
    In XmlDataReader evaluate , insert
        if (!value.hasOwnProperty(member)) { return null; }  /* RAD 3/21/12, allow null data or no path to member situations */
    before
        value = value[member];

    In XmlDataReader parse, the body was modified to be
        var documentElement, tree, result = {};
        try { // RAD 3/21/12, handle invalid XML as a 'no data' situation
            documentElement = xml.documentElement || $.parseXML(xml).documentElement;
            tree = this.parseDOM(documentElement);
            result[documentElement.nodeName] = tree;
       }
       catch ( _ ) {  }

       return result;
    -----

    I will likely need to clean up other various errors that crop up, hope this helps other XMLers

Back to Top