[CLOSED] CheckBoxGroup Items Checked from DirectEvent

  1. #1

    [CLOSED] CheckBoxGroup Items Checked from DirectEvent

    Hi, How Can I to get the items on checked to CheckBoxGroup from directevents with a ext:Parameter in Value property?.

    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server">
            </ext:ResourceManager>
    
            <ext:FieldSet
                ID="fsGrupoEstudios"
                runat="server" 
                Width="455"
                Height="125"
                Margins="0 0 0 0"
                AutoScroll="true"
                Layout="AbsoluteLayout">
                <Items>
                    <ext:CheckboxGroup
                        ID="cbgGrupoEstudios"
                        runat="server"
                        Layout="AbsoluteLayout"
                        AutoScroll="false"
                        Height="120"
                        Width="410">
                    </ext:CheckboxGroup>
                </Items>
            </ext:FieldSet>
    
            <ext:Button ID="Button1" runat="server" Text="Submit">
                <DirectEvents>
                    <Click OnEvent="Button1_Click">
                        <ExtraParams>
                            <ext:Parameter Name="grupoEstudios" Value="" Mode="Raw" Encode="true" />
                        </ExtraParams>
                    </Click>
                </DirectEvents>
            </ext:Button>
    
    
        </form>
    </body>
            protected void Page_Load(object sender, EventArgs e)
            {
                if (!X.IsAjaxRequest)
                {
                    //Agregar grupos de estudios
                    List<ArtGrupo> lArtGrupo = new List<ArtGrupo>();
    
                    for (int i = 0; i < 10; i++)
                    {
                        ArtGrupo oArtGrupo = new ArtGrupo();
                        oArtGrupo.Grupo = "Grupo" + i;
                        oArtGrupo.Descripcion = "Descripcion" + i;
    
                        lArtGrupo.Add(oArtGrupo);
                        oArtGrupo = null;
                    }
    
                    int y = 0;
                    foreach (ArtGrupo sd in lArtGrupo)
                    {
                        cbgGrupoEstudios.Items.Add(new Checkbox { BoxLabel = sd.Grupo, InputValue = sd.Grupo, Checked = false, Y = y });
                        y += 20;
                    }
                }
            }
    
            protected void Button1_Click(object sender, DirectEventArgs e)
            {
            }
    
            class ArtGrupo
            {
                string grupo;
                string descripcion;
    
                public string Grupo
                {
                    get { return grupo; }
                    set { grupo = value; }
                }
    
                public string Descripcion
                {
                    get { return descripcion; }
                    set { descripcion = value; }
                }
            }
    Last edited by Daniil; Apr 02, 2014 at 1:24 AM. Reason: [CLOSED]
  2. #2
    Hi @osef,

    Do you not want to recreate a CheckboxGroup's Checkboxes on each request? That way you could use a CheckboxGroup's CheckedItems during a DirectEvent.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @osef,

    Do you not want to recreate a CheckboxGroup's Checkboxes on each request? That way you could use a CheckboxGroup's CheckedItems during a DirectEvent.
    Daniil I'm sorry the CheckBox items of CheckboxGroup is created in afterrender event and it is not in page load. How Can I to get the InputValue of each CheckBox items with Checked?

    What code is here in Value?

                        <ExtraParams>
                            <ext:Parameter Name="grupoEstudios" Value="" Mode="Raw" Encode="true" />
                        </ExtraParams>
    Last edited by osef; Mar 29, 2014 at 5:31 AM.
  4. #4
    A CheckboxGroup's getValue method should be good enough.

    App.cbgGrupoEstudios.getValue()
    http://docs.sencha.com/extjs/4.2.1/#...ethod-getValue
  5. #5
    Quote Originally Posted by Daniil View Post
    A CheckboxGroup's getValue method should be good enough.

    App.cbgGrupoEstudios.getValue()
    http://docs.sencha.com/extjs/4.2.1/#...ethod-getValue
    Thank you Daniil, but How Can I Deserialize in server side?
  6. #6
    You can use
    JSON.Deserialize<type>("jsonString")
  7. #7
    Quote Originally Posted by Daniil View Post
    You can use
    JSON.Deserialize<type>("jsonString")
    Thank you Daniil.

Similar Threads

  1. [CLOSED] CheckboxGroup items - find specific item
    By Hlodvig in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 05, 2013, 9:56 PM
  2. [CLOSED] Get Checked items of checkbox group
    By mohan.bizbites in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 21, 2013, 5:02 PM
  3. Replies: 3
    Last Post: Jun 02, 2011, 8:45 PM
  4. CheckboxGroup dynamic items error
    By Argons in forum 1.x Help
    Replies: 3
    Last Post: Jul 30, 2009, 1:14 PM
  5. Replies: 3
    Last Post: Jun 01, 2009, 5:29 PM

Tags for this Thread

Posting Permissions