This is a migrated thread and some comments may be shown as answers.

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

1 Answer 56 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 17 Mar 2012, 06:29 AM
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

1 Answer, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 1
answered on 21 Mar 2012, 09:53 AM
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
Tags
Data Source
Asked by
Richard
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
Share this question
or