Check all checkbox in a gridPanel using a button(Select all)

  1. #1

    Check all checkbox in a gridPanel using a button(Select all)

    Hi All,

    Is it possible to check all checkboxs in a gridpanel using a button(select all) ?
    If possible can you please suggest the approach i should take to acheive it.
    I have looked into some the posts but could not find an answer.

    
    
    
    
    <ext:GridPanel ID="GridPanel1" runat="server" Header="false" Border="false" StoreID="dsCustomers" TrackMouseOver="true" ClicksToEdit="1" remoteSort="true">
    <ColumnModel ID="ColumnModel1" runat="server">
    <Columns>
    <ext:Column ColumnID="TradeId" DataIndex="TradeId" Header="TradeId" Hidden="true"></ext:Column>
    <ext:CheckColumn DataIndex="Principal_Approval" Header="Principal" Sortable="false" Width="70%">
    </ext:CheckColumn>
    <ext:CheckColumn DataIndex="Trade_Approval" Header="Review" Sortable="false" Width="60%">
    </ext:CheckColumn>
    <ext:Column ColumnID="Markup_Vs_Grid" DataIndex="Markup_Vs_Grid" Header="MarkupVsGrid" Sortable="true" Width="80%">
    </ext:Column>
    </Columns> 
    </ColumnModel>
    
    
    
    
    <TopBar>
    <ext:Toolbar ID="Toolbar1" runat="server">
    <Items>
    <ext:Button ID="Button2" runat="server" Text="Select All" Icon="Accept">
    
    
    
    <%--
    some events to select all checkboxs in the gridpanel 
    --%>
    
    </ext:Button>
    </Items>
    </ext:Toolbar>
    </TopBar>
    </ext:GridPanel>
  2. #2

    RE: Check all checkbox in a gridPanel using a button(Select all)

    is it possible to generate an afteredit event programatically using javascript?

    I mean that when i click the button, the click event is fired and some javascript function to programatically make changes on the gridpanel so that afterEdit event is fired.

    Something like Onclik event fires another Event. In this case it is AfterEdit Event.


  3. #3

    RE: Check all checkbox in a gridPanel using a button(Select all)

    Hi ,

    I think i found post related to this...


    <P class=MsoNormal style="MARGIN: 0in 0in 0pt">http://forums.ext.net/showthread.php...light=checkbox


    Thank you,
  4. #4

    RE: Check all checkbox in a gridPanel using a button(Select all)

    Hi all,

    I have button that checks all check boxs in the grid panel (Rows count is more than 500).
    But IE is returning "Stop Running Script?"
    can someone help me to solve this issue.

    Here is the Code

    
    
    
    <ext:GridPanel ID="GridPanel1" runat="server" Header="false" Border="false" StoreID="dsCustomers" TrackMouseOver="true" ClicksToEdit="1" remoteSort="true">
    
    <ColumnModel ID="ColumnModel1" runat="server">
    <Columns>
    
    <ext:Column ColumnID="TradeId" DataIndex="TradeId" Header="TradeId" Hidden="true" ></ext:Column>
    <ext:CheckColumn DataIndex="Principal_Approval" Header="Principal" Sortable="false" Width="70%" Editable="true" Align="Center"> </ext:CheckColumn>
    <ext:CheckColumn DataIndex="Trade_Approval" Header="Review" Sortable="false" Width="60%" Editable="true" Align="Center"></ext:CheckColumn>
    <ext:Column ColumnID="Markup_Vs_Grid" DataIndex="Markup_Vs_Grid" Header="MarkupVsGrid" Sortable="true" Width="80%" Align="Center"></ext:Column>
    
    </Columns> 
    
    </ColumnModel>
    
    <TopBar>
    <ext:Toolbar ID="Toolbar1" runat="server">
    <Items>
    <ext:Button ID="Button1" runat="server" Text="Save Changes" Icon="TableSave">
    <Listeners><Click Handler="#{dsCustomers}.save();" />
    </Listeners>
    </ext:Button>
    
    <ext:ToolbarSpacer ID="ToolbarSpacer1" runat="server" />
    
    
    <ext:Button ID="Button2" runat="server" Text="Approve All" Icon="Accept">
    <Listeners> 
    <Click Handler="change(#{GridPanel1},true);" /> 
    </Listeners>
    </ext:Button>
    
    <ext:ToolbarSeparator ID="ToolbarSeparator2" runat="server" />
    
    <ext:Button ID="Button3" runat="server" Text="Decline All" Icon="Decline">
    <Listeners>
    <Click Handler="change(#{GridPanel1},false);" /> 
    </Listeners>
    </ext:Button>
    
    </Items></ext:Toolbar>
    </TopBar>
    JavaScript Code

    
    
    
    var change = function(grid, value) {
    grid.store.each(function(record, index) {
    
    
    
    if (value == false) {
    
    
    record.set('Principal_Approval', value); 
    
    
    grid.view.refresh(false);
    
    
    }
    
    
    if (value == true) {
    
    
    var c = record.get('Trade_Approval');
    
    
    if (c == false) {
    
    
    record.set('Principal_Approval', value);
    
    
    grid.view.refresh(false);
    
    
    }
    
    
    }
    
    
    
    
    
    });
    
    
    }

Similar Threads

  1. [CLOSED] how to run event only check select GridPanel
    By egvt in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: May 21, 2012, 8:13 PM
  2. Replies: 1
    Last Post: Jul 06, 2011, 11:22 PM
  3. Replies: 0
    Last Post: Feb 10, 2011, 1:04 PM
  4. [CLOSED] Help with checkbox in gridpanel header to select all rows
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 24, 2010, 7:41 PM
  5. Replies: 1
    Last Post: Aug 13, 2009, 9:37 AM

Posting Permissions