Results 1 to 2 of 2

Thread: How to dynamically add checkboxgroup in a form panel

  1. #1

    Question How to dynamically add checkboxgroup in a form panel

    Hi,
    I am so tired to dynamically add checkboxgroup in formpanel.
    Please help me.


    Thanks
    Tuhin

  2. #2
    Sencha User grgur's Avatar
    Join Date
    Aug 2007
    Location
    Split, Croatia
    Posts
    155

    Default

    Just add your checkboxgroup or any other field/set of fields, followed by doLayout()

    e.g.:
    Code:
    var newCheckBoxGroup = {
    	xtype: 'checkboxgroup',
    	fieldLabel: 'New cbgroup',
    	items: [{
    		columnWidth: '.6',
    		items: [
    			{xtype: 'label', text: 'Heading 1'},
    			{boxLabel: 'Item 1', name: 'cb1'},
    			{boxLabel: 'Item 2', name: 'cb2'}
    		]
    	},{
    		columnWidth: '.4',
    		items: [
    			{xtype: 'label', text: 'Heading 2'},
    			{boxLabel: 'Item 3', name: 'cb3'}
    		]
    	}]
    }
    
    var fp = new Ext.FormPanel({...});
    /* ... business logic ... */
    
    fp.add(newCheckBoxGroup);
    fp.doLayout();
    Last edited by grgur; 16 May 2011 at 11:31 AM. Reason: simplified example
    <div style="float: left; width: 70px;">http://appac.us/mcs.png</div><div style="float: left; height: 100px;">Grgur Grisogono
    Ext JS in Action SE co-author
    Exercising awesomeness at Modus Create - Official Sencha Partner

    Get in touch for Sencha Touch Training
    @ggrgur</div><div style="clear:both;"></div>

Similar Threads

  1. Add checkBoxes group into Extjs CheckBoxgroup Dynamically from Database
    By saurabh.s in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 9 Feb 2011, 4:25 AM
  2. Dynamically Adding a CheckboxGroup to the Form Panel using JSONStore
    By nunna1981 in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 1 Sep 2010, 6:59 AM
  3. Dynamically created checkboxes do not appear in the checkboxgroup
    By paweluz in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 25 Jun 2010, 1:48 AM
  4. I'm trying to concatenate a checkboxgroup dynamically to an array
    By devansjr37 in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 24 Nov 2009, 2:20 PM
  5. Can wee add form elements dynamically to a Panel.
    By rudy23 in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 2 Jul 2008, 8:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •