Fix #6201 - Category select
[roojs1] / Roo / data / Store.js
index 9dafec4..7cc3272 100644 (file)
@@ -233,6 +233,7 @@ Roo.extend(Roo.data.Store, Roo.util.Observable, {
     remove : function(record){
         var index = this.data.indexOf(record);
         this.data.removeAt(index);
         if(this.pruneModifiedRecords){
             this.modified.remove(record);
         }
@@ -421,15 +422,15 @@ Roo.extend(Roo.data.Store, Roo.util.Observable, {
             this.add(r);
         }
         
-//        if(this.parent && this.parent.emptyTitle.length) {
-//                
-//            var e = new Roo.data.Record({});
-//
-//            e.set(this.parent.displayField, this.parent.emptyTitle);
-//            e.set(this.parent.valueField, '');
-//
-//            this.insert(0, e);
-//        }
+        if(this.parent && !Roo.isIOS && !this.useNativeIOS && this.parent.emptyTitle.length) {
+                
+            var e = new Roo.data.Record({});
+
+            e.set(this.parent.displayField, this.parent.emptyTitle);
+            e.set(this.parent.valueField, '');
+
+            this.insert(0, e);
+        }
             
         this.fireEvent("load", this, r, options, o);
         if(options.callback){
@@ -449,6 +450,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.