roojs-all.js
[roojs1] / examples / bootstrap / ComboBox2.js
index abb4e6e..a27eb0c 100644 (file)
@@ -21,7 +21,7 @@ Roo.example.combobox = new Roo.XComponent({
         
         var _this = this;
         var MODULE = this;
-        var baseURL = '/web.eventmanager/demo.local.php';
+        var baseURL = '/web.roojsolutions/index.local.php';
         
         return {
             xtype: 'Body',
@@ -31,14 +31,14 @@ Roo.example.combobox = new Roo.XComponent({
                     xtype: 'ComboBox',
                     xns: Roo.bootstrap,
                     placeholder : 'Select a country',
-                    displayField : 'name',
+                    displayField : 'title',
                     hiddenName : 'country_id',
                     md : '12',
                     size : 'sm',
                     name : 'country_id_name',
                     triggerAction : 'all',
                     minChars : '1',
-                    tpl : '<li class="select2-result"><b>{name}</b></div>',
+                    tpl : '<li class="dropdown-item  roo-select2-result "><b>{title}</b></li>',
                     listWidth : '400',
                     style : 'margin-top:20px;',
                     multiple: true,
@@ -63,12 +63,6 @@ Roo.example.combobox = new Roo.XComponent({
                             beforeload : function (_self, o) {
                                 o.params = o.params || {};
                                 
-                                var selected = _this.normalSel.getValue();
-                                
-                                if(selected.length){
-                                    o.params._skip = selected;
-                                }
-                                
                             }
                         },
                         remoteSort : true,
@@ -76,7 +70,7 @@ Roo.example.combobox = new Roo.XComponent({
                         proxy : {
                             xtype: 'HttpProxy',
                             xns: Roo.data,
-                            url : baseURL + '/Geoip/Core_geoip_country',
+                            url : '../bootstrap/data.country.js',
                             method : 'GET'
                         },
                         reader : {
@@ -92,7 +86,7 @@ Roo.example.combobox = new Roo.XComponent({
                                     'type': 'string'
                                 },
                                 {
-                                    'name': 'name',
+                                    'name': 'title',
                                     'type': 'string'
                                 }
                             ]
@@ -100,34 +94,32 @@ Roo.example.combobox = new Roo.XComponent({
                     }
                 },
                 {
-                    xtype: 'ComboBox2',
+                    xtype: 'ComboBox',
                     xns: Roo.bootstrap,
                     placeholder : 'Select a country',
-                    displayField : 'name',
+                    displayField : 'title',
                     hiddenName : 'country_id',
                     md : '12',
                     size : 'sm',
                     name : 'country_id_name',
                     triggerAction : 'all',
                     minChars : '1',
-                    tpl : '<li class="select2-result"><b>{name}</b></div>',
-                    listWidth : '400',
+//                    tpl : '<li class="roo-select2-result"><b>{name}</b></div>',
                     style : 'margin-top:20px;',
                     multiple: true,
+                    tickable: true,
                     listeners : {
                         render : function (_self) {
-                            _this.checkSel = _self;
+                            _this.tickableSel = _self;
                         }
                     },
                     forceSelection : true,
                     valueField : 'id',
-                    queryParam : 'query[name]',
+                    queryParam : 'query[title]',
                     editable : true,
                     alwaysQuery : true,
                     allowBlank : false,
-                    fieldLabel : 'Country With CheckBox',
-                    pageSize : '10',
-                    append: true,
+                    fieldLabel : 'Country With Tickable',
                     store : {
                         xtype: 'Store',
                         xns: Roo.data,
@@ -135,12 +127,6 @@ Roo.example.combobox = new Roo.XComponent({
                             beforeload : function (_self, o) {
                                 o.params = o.params || {};
                                 
-                                var selected = _this.checkSel.getValue();
-                                
-                                if(selected.length){
-                                    o.params._skip = selected;
-                                }
-                                
                             }
                         },
                         remoteSort : true,
@@ -148,7 +134,7 @@ Roo.example.combobox = new Roo.XComponent({
                         proxy : {
                             xtype: 'HttpProxy',
                             xns: Roo.data,
-                            url : baseURL + '/Geoip/Core_geoip_country',
+                            url : '../bootstrap/data.country.js',
                             method : 'GET'
                         },
                         reader : {
@@ -164,7 +150,7 @@ Roo.example.combobox = new Roo.XComponent({
                                     'type': 'string'
                                 },
                                 {
-                                    'name': 'name',
+                                    'name': 'title',
                                     'type': 'string'
                                 }
                             ]