[CLOSED] CheckboxGroup

  1. #1

    [CLOSED] CheckboxGroup

    hi,

    how to add checkboxes within CheckboxGroup in clientside?
  2. #2

    RE: [CLOSED] CheckboxGroup

    Hi,

    Please note that Checkbox/Radio group doesn't support officially dynamic adding/removing items. Therefore no warranty that the following code will work correctly always

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
            
             <ext:CheckboxGroup ID="Group1" runat="server" Vertical="true" Height="150" ColumnsNumber="1">
                <Items>
                    <ext:Checkbox runat="server" BoxLabel="Label1" />
                    <ext:Checkbox runat="server" BoxLabel="Label2" />
                    <ext:Checkbox runat="server" BoxLabel="Label3" />
                </Items>
             </ext:CheckboxGroup> 
             
             <ext:Button runat="server" Text="Add">
                <Listeners>
                    <Click Handler="var column1 = Group1.panel.getComponent(0);var radio = column1.add({xtype:'checkbox', inputValue:'val4', boxLabel: 'Label 4'});Group1.items.add(radio);Group1.panel.doLayout();" />
                </Listeners>
             </ext:Button>
        </form>
    </body>
    </html>
    Please note that 'inputValue' checkbox config can help to find the value in submitted collection (in Request.Form)
  3. #3

    RE: [CLOSED] CheckboxGroup

    hi,

    how to remove the items in the checkboxgroup... i try the below code but remove only some items in the checkboxgroup, not all items...

    how to remove the all items in the checkbox group and how to know whether the checkbox is checked or not in server side ajax event....


    Thanks in advance...

    
    
    
    
    function Del()
    
    
    { 
    
    
    
    
    
    
    
    
    var column1 = Group1.panel.getComponent(0);
    
    
    for(i=0;i<column1.items.length;i++)
    
    
    { 
    
    
    column1.remove(i); 
    
    
    }
    
    
    Group1.panel.doLayout();}
  4. #4

    RE: [CLOSED] CheckboxGroup

    Hi,

    1. remove all
    function removeAll()
            { 
                var column1 = Group1.panel.getComponent(0);
                
                while(column1.items.getCount() > 0){
                    column1.remove(column1.getComponent(0));
                }
                
                Group1.items.clear();
                Group1.panel.doLayout();
            }
    2. To check dynamic checkbox (which was added on client side)
    You need to set 'id' or 'name' for checkbox
    column1.add({xtype:'checkbox', name:'val4', boxLabel: 'Label 4'});
    On server side check Request.Form
    string val = this.Request.Form["val4"];
    If 'val' equals 'on' then checked
    If 'val' is null then such checkbox is absent or unchecked

Similar Threads

  1. [CLOSED] TreePanel CheckBoxGroup
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Jun 26, 2011, 8:16 PM
  2. [CLOSED] CheckboxGroup, RadioGroup & IE6
    By Justin_Wignall in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 26, 2011, 1:08 PM
  3. [CLOSED] checkboxgroup issue
    By idrissb in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 13, 2009, 10:48 AM
  4. [CLOSED] CheckBoxGroup and AjaxEvent
    By idrissb in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 04, 2009, 4:51 PM
  5. [CLOSED] Checkboxes in CheckBoxGroup
    By methode in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 11, 2009, 3:27 PM

Posting Permissions