X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=roojs-bootstrap-debug.js;h=0ab5de6302732f1f5dafbe963d6e092917fe4def;hp=a9f8f5de6bfe68048e1b6f8abb6c5bd03e5e0671;hb=refs%2Fheads%2Fwip_alan_T6201_Category_select;hpb=a4d1df33898b6a98b1e6a175114e858724578040 diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index a9f8f5de6b..0ab5de6302 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -11825,6 +11825,16 @@ Roo.extend(Roo.data.Store, Roo.util.Observable, { var r = this.reader.readRecords(o); this.loadRecords(r, {add: append}, true); }, + + /** + * using 'cn' the nested child reader read the child array into it's child stores. + * @param {Object} rec The record with a 'children array + */ + loadDataFromChildren : function(rec) + { + this.loadData(this.reader.toLoadData(rec)); + }, + /** * Gets the number of cached records. @@ -13020,6 +13030,14 @@ Roo.extend(Roo.data.JsonReader, Roo.data.DataReader, { records : records, totalRecords : totalRecords }; + }, + // used when loading children.. @see loadDataFromChildren + toLoadData: function(rec) + { + // expect rec just to be an array.. eg [a,b,c, [...] << cn ] + var data = typeof(rec.data.cn) == 'undefined' ? [] : rec.data.cn; + return { data : data, total : data.length }; + } });/* * Based on: @@ -13076,8 +13094,7 @@ Roo.data.ArrayReader = function(meta, recordType) Roo.extend(Roo.data.ArrayReader, Roo.data.JsonReader, { - readerType : 'Array', - /** + /** * Create a data block containing Roo.data.Records from an XML document. * @param {Object} o An Array of row objects which represents the dataset. * @return {Object} A data block which is used by an {@link Roo.data.Store} object as @@ -13108,7 +13125,16 @@ Roo.extend(Roo.data.ArrayReader, Roo.data.JsonReader, { records : records, totalRecords : records.length }; + }, + // used when loading children.. @see loadDataFromChildren + toLoadData: function(rec) + { + // expect rec just to be an array.. eg [a,b,c, [...] << cn ] + return typeof(rec.data.cn) == 'undefined' ? [] : rec.data.cn; + } + + });/* * - LGPL * *