ExtJs CheckboxGroup用法实例

呈现的时候: 

for (var i = 1; i <= AimState["TotalPages"]; i++) {//禁用已经拆分过的页码
                    var splited = false;
                    $.each(selpagearray, function() {
                        if (this && this == i) {
                            splited = true;
                            return false;
                        }
                    });
                    itemarray.push({ boxLabel: "第" + i + "页", name: i, disabled: splited, checked: splited });
                }
                cbg = new Ext.form.CheckboxGroup({
                    id: 'myGroup',
                    xtype: 'checkboxgroup',
                    fieldLabel: 'Single Column',
                    itemCls: 'x-check-group-alt',
                    renderTo: 'div2',
                    columns: 12,
                    items: itemarray
                })

提交的时候获取值

  var selPages = "";
            $.each(cbg.getValue(), function() {
                if (!this.disabled && this.checked) {
                    selPages += this.name + ",";
                }
            })
            return selPages;

posted @ 2014-01-09 21:18  silence2010  阅读(210)  评论(0)    收藏  举报