Roo/form/ComboNested.js
authorAlan Knowles <alan@roojs.com>
Mon, 10 Feb 2020 04:58:55 +0000 (12:58 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 10 Feb 2020 04:58:55 +0000 (12:58 +0800)
Roo/form/ComboNested.js

index da1f0f1..b51ed31 100644 (file)
@@ -295,11 +295,12 @@ Roo.extend(Roo.form.ComboNested, Roo.form.ComboBox, {
                 ((this.listWidth * 3 || Math.max(this.wrap.getWidth(), this.minListWidth)) - this.list.getFrameWidth('lr')) / 3
         );
         var data =  typeof(rec.data.cn) == 'undefined' ? [] : rec.data.cn;
+        var dl = typeof(data.data.cn) ? data.data.total : data.length; ///json is a nested response..
         this.stores[opts.list+1].loadData( data );
         this.views[opts.list+1].getEl().setHeight( this.innerLists[0].getHeight());
-        this.views[opts.list+1].getEl().setStyle({ display : data .length ? 'block' : 'none' });
+        this.views[opts.list+1].getEl().setStyle({ display : dl ? 'block' : 'none' });
         this.innerLists[opts.list+1].setHeight( this.innerLists[0].getHeight());
-        this.list.setWidth(lw * (opts.list + (data.length ? 2 : 1))); 
+        this.list.setWidth(lw * (opts.list + (dl ? 2 : 1))); 
     },
     onDoubleClick : function()
     {