X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=roojs-bootstrap-debug.js;h=0ab5de6302732f1f5dafbe963d6e092917fe4def;hp=1afc748c6639c0254074015912bf2f36475e0c0b;hb=refs%2Fheads%2Fwip_alan_T6201_Category_select;hpb=e230f44a07d8f55fe7e32de8776f23c6ff1efb3c diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 1afc748c66..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: @@ -13108,14 +13126,11 @@ Roo.extend(Roo.data.ArrayReader, Roo.data.JsonReader, { totalRecords : records.length }; }, - /** - * using 'cn' the nested child reader read the child array into it's child stores. - * - */ - loadDataFromChildren: function(rec) + // used when loading children.. @see loadDataFromChildren + toLoadData: function(rec) { // expect rec just to be an array.. eg [a,b,c, [...] << cn ] - return this.loadData(rec.data.cn); + return typeof(rec.data.cn) == 'undefined' ? [] : rec.data.cn; }