[CLOSED] GridPanel Cell click and check box selection

  1. #1

    [CLOSED] GridPanel Cell click and check box selection

    Hi,

    I have gridpanel, i need the check box selection and cell click also.
    in first column checkbox
    in second column name
    in third column date and time
    in fourth column image.(by clicking this image column i am downloading the file)

    code as follows
    <ext:GridPanel ID="GrdPnl1" runat="server" StoreID="Sto1" StripeRows="true" Height="150" Header="false" Border="false">
    <ColumnModel>
    <Columns>
    <ext:CheckColumn DataIndex="Chk" Fixed="true" Width="50" Editable="true">
    </ext:CheckColumn>
    <ext:Column DataIndex="Chk" ></ext:Column>
    <ext:Column DataIndex="Name" ></ext:Column>
    <ext:Column DataIndex="Filedate" Width="150"></ext:Column>
    <ext:Column DataIndex="FileAttachment" Width="50">
    <Renderer Fn="Imagerender" />
    </ext:Column>
    </Columns>
    </ColumnModel>
    <Listeners>
    <CellClick Fn="cellClick" />
    </Listeners>
    </ext:GridPanel>
    
    
    
    <ext:Store ID="Sto1" runat="server">
    <Reader >
    <ext:JsonReader ReaderID="ATTACH_NO">
    <Fields>
    <ext:RecordField Name="Chk">
    </ext:RecordField>
    <ext:RecordField Name="Name"></ext:RecordField>
    <ext:RecordField Name="Filedate">
    </ext:RecordField>
    <ext:RecordField Name="FileAttachment"></ext:RecordField>
    </Fields>
    </ext:JsonReader>
    </Reader>
    </ext:Store>
    i need multiple check box selection and if i click the image in grid i need to download the file how to do this

    thanks and regards
    speedstep
  2. #2

    RE: [CLOSED] GridPanel Cell click and check box selection

    Hi,

    I am not sure that clear understand about checkbox. What is "multiple check box selection"? Please provide details about that.


    For download file use renderer which render hyperlink with required url


    <Renderer Handler="return '<a src=\''+value+'\'>Download</a>';"/>
  3. #3

    RE: [CLOSED] GridPanel Cell click and check box selection

    Hi,

    i have grid panel. In this grid i need first column check box and in last column image icon for download. the grid is multiselect one. my problem is when i select multiple check box in grid and click the image button file is downloading and focus is removing in grid
  4. #4

    RE: [CLOSED] GridPanel Cell click and check box selection




    
    
    
    
    <ext:GridPanel ID="GrdPnl1" runat="server" StoreID="Sto1" 
    
    
    StripeRows="true" Height="150" Header="false" Border="false">
    
    
    <ColumnModel>
    
    
    <Columns>
    
    
    <%--<ext:CheckColumn DataIndex="Chk" Fixed="true" Width="50" Editable="true">
    
    
    </ext:CheckColumn>--%> 
    
    
    <ext:Column DataIndex="CAPTION" >
    
    
    </ext:Column>
    
    
    <ext:Column DataIndex="STATE1" >
    
    
    </ext:Column>
    
    
    <ext:Column DataIndex="FILEDATE1" Width="150">
    
    
    </ext:Column>
    
    
    <ext:Column DataIndex="FILENAME" Width="50">
    
    
    <Renderer Fn="Imagerender" />
    
    
    </ext:Column>
    
    
    <ext:Column DataIndex="STATE" Hidden="true">
    
    
    </ext:Column>
    
    
    <ext:Column DataIndex="HIST_NO" Hidden="true">
    
    
    </ext:Column>
    
    
    <ext:Column DataIndex="ATTACH_NO" Hidden="true">
    
    
    </ext:Column>
    
    
    </Columns>
    
    
    </ColumnModel>
    
    
    <SelectionModel>
    
    
    <ext:CheckboxSelectionModel HideCheckAll="true" SingleSelect="false" ID="ChkSM1" runat="server">
    
    
    <AjaxEvents>
    
    
    <RowSelect OnEvent="ChkSelectionClick" ShowWarningOnFailure="false" Timeout="120000">
    
    
    <ExtraParams>
    
    
    <ext:Parameter Name="Values" Value="Ext.encode(#{GrdPnl1}.getRowsValues(true))" Mode="Raw" />
    
    
    </ExtraParams>
    
    
    </RowSelect>
    
    
    </AjaxEvents>
    
    
    <Listeners>
    
    
    
    
    
    </Listeners>
    
    
    </ext:CheckboxSelectionModel>
    
    
    </SelectionModel> 
    
    
    </ext:GridPanel>
  5. #5

    RE: [CLOSED] GridPanel Cell click and check box selection

    Hi,

    I don't understand what is "multiple check box" and what problems do have with "multiple check box"? I see that you use CheckColumnwith editable capability. Why you need CheckColumn with editing? Do you save grid? Why you don't use CheckBoxSelectionModel?


    When you download file the gird will loose the focus. It is correct because modal dialog takes the focus. I am not sure about possibolity to return focus back because we don't know when modal dialog will be closed


    Can you describe you issues with more details? I am still confusing what problems I have to resolve for you
  6. #6

    RE: [CLOSED] GridPanel Cell click and check box selection

    Hi,

    I have binded the grid sucessfully.
    In 1st column checkbox,2nd column name,3rd column date and 4th column image
    i used multiselect in grid.
    when i use singleselect in grid, and click the image icon in grid the file is downloading. but when i select first 3 rows in grid and after click the 2nd row focus is removed and image downloaded file is wrong its downloading 3rd row file..

    how to correct this.. please send me how to do this..


  7. #7

    RE: [CLOSED] GridPanel Cell click and check box selection

    Hi,

    We have added CheckOnly property for CheckboxSelectionModel. If true then selection will perform on checkbox click only.
    Please see the following sample
    
    <%@ 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">
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Ext.IsAjaxRequest)
            {
                this.Store1.DataSource = new object[]
                {
                    new object[] {"Column1_1", "Column1_2", "File1"},
                    new object[] {"Column2_1", "Column2_2", "File2"},
                    new object[] {"Column3_1", "Column3_2", "File3"},
                    new object[] {"Column4_1", "Column4_2", "File4"},
                    new object[] {"Column5_1", "Column5_2", "File5"},
                    new object[] {"Column6_1", "Column6_2", "File6"}
                };
    
                this.Store1.DataBind();
            }
        }
    </script>
    
    <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:Store ID="Store1" runat="server">
                <Reader>
                    <ext:ArrayReader>
                        <Fields>
                            <ext:RecordField Name="Column1" />
                            <ext:RecordField Name="Column2" />
                            <ext:RecordField Name="Url" />
                        </Fields>
                    </ext:ArrayReader>
                </Reader>
            </ext:Store>
            
            <ext:GridPanel 
                ID="GridPanel1" 
                runat="server" 
                StoreID="Store1" 
                Title="Array Grid" 
                Width="600" 
                Height="350">
                <ColumnModel ID="ColumnModel1" runat="server">
                    <Columns>
                        <ext:Column ColumnID="Column1" Header="Column1" DataIndex="Column1" />
                        <ext:Column ColumnID="Column2" Header="Column2" DataIndex="Column2" />
                        
                        <ext:Column DataIndex="Url">
                            <Renderer Handler="return '<a href=\''+value+'\' target=\'_blank\'>Download</a>';"/>
                        </ext:Column>
                    </Columns>
                </ColumnModel>
                <SelectionModel>
                    <ext:CheckboxSelectionModel runat="server" CheckOnly="true" SingleSelect="false"></ext:CheckboxSelectionModel>
                </SelectionModel>     
                
            </ext:GridPanel>   
        </form>
    </body>
    </html>
  8. #8

    RE: [CLOSED] GridPanel Cell click and check box selection

    Hi,

    It's works fine...

    Thanks &amp; Regards
    Speedstep

Similar Threads

  1. Replies: 1
    Last Post: Jul 10, 2012, 11:16 AM
  2. [CLOSED] gridPanel: cell selection after store load
    By RomualdAwessou in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 18, 2011, 5:16 PM
  3. Replies: 2
    Last Post: Mar 21, 2010, 1:18 PM
  4. Replies: 1
    Last Post: Aug 13, 2009, 9:37 AM
  5. Check box selection in Gridpanel using version 0.8
    By speedstepmem3 in forum 1.x Help
    Replies: 0
    Last Post: Jun 04, 2009, 1:02 AM

Posting Permissions