Closed GoogleCodeExporter closed 8 years ago
Hello! Thanks for the report!
What do you think about element.element.asArray format instead current?
I mean like an additional function (like toString).
Original comment by abdulla....@gmail.com
on 9 Aug 2013 at 9:53
or
<element>...<element>.__asArray
Original comment by abdulla....@gmail.com
on 9 Aug 2013 at 10:00
I suggest you can set a option like needArray. if that is false then don't
create _asArray attribute.
Because many project need auto generate infomation from json data. like below
for (var p in jsonData.rows[0]) {
if (p != "rowStyle" && p != "cellStyle") {
var col = this.getDefaultColumn();
col.field = p;
col.title = p;
this.addColumn(col);
}
}
Original comment by bbdragoner@gmail.com
on 10 Aug 2013 at 1:49
But it looks like if I change <element_>asArray _property_ format to
<element>.__asArray _function_ (like toString()) there is no need for an
additional option, isn't?
Original comment by abdulla....@gmail.com
on 10 Aug 2013 at 1:27
If you change to <element>.__asArray then <element> will be object type not
string type right??
And I dno't understand what need __asArray. Beacuse my origin json is not had
this...
Original comment by bbdragoner@gmail.com
on 12 Aug 2013 at 1:58
Yes, it will be Object type with toString(). But you shouldn't expect always
string there. If you have CDATA, attributes, namespace in your XML element you
will receive Object (with additional properties).
__asArray is required to work with XML to access fields always in array form
(for XSD elements with minOccurs > 1). X2JS can't detect array/single element
without XSD knowledge in runtime.
Original comment by abdulla....@gmail.com
on 12 Aug 2013 at 8:50
But many XML use is simply for javascript. So I think may be can use a option
to check what is user want to use.
I found another code can use to my project. You can see to
http://goessner.net/download/prj/jsonxml/. This jsonxml I was foun in jqGrid.
But It's not include xmlstr to json function.
Original comment by bbdragoner@gmail.com
on 12 Aug 2013 at 9:33
Well, ok. I will think about additional option for __asArray. Maybe for some
cases it is redundant.
Original comment by abdulla....@gmail.com
on 12 Aug 2013 at 10:58
Fixed in 1.1.0
Original comment by abdulla....@gmail.com
on 12 Aug 2013 at 1:54
Original comment by abdulla....@gmail.com
on 29 Sep 2013 at 3:14
Original issue reported on code.google.com by
bbdragoner@gmail.com
on 9 Aug 2013 at 7:28