[CLOSED] Command Column Disabled GridCommand in a Row

  1. #1

    [CLOSED] Command Column Disabled GridCommand in a Row

    Hi team I want to disabled a GridCommand in a specified row, but, with my example I get to disable all GridCommand Column, BY example I want to disable the row number 2 in the GridCommand "Test1".






    All this with a Button "btnDisableRow"

            <ext:ResourceManager ID="rmDefault" runat="server" HideInDesign="true" />
    
            <ext:GridPanel
                ID="gpDefault"
                runat="server"
                Height="200"
                Width="303">
                <Store>
                    <ext:Store ID="sDefault" runat="server">
                        <Model>
                            <ext:Model ID="mDefault" runat="server">
                                <Fields>
                                    <ext:ModelField Name="Column1" Type="String" />
                                    <ext:ModelField Name="Column2" Type="String" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
                <TopBar>
                    <ext:Toolbar ID="tbDefault" runat="server">
                        <Items>
                            <ext:Button ID="btnEnable" Text="Disable Command 1" runat="server">
                                <Listeners>
                                    <Click Handler="App.ccPrueba.commands[0].disabled = true; App.gpDefault.reconfigure();" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="btnDisable" Text="Enable Command 1" runat="server">
                                <Listeners>
                                    <Click Handler="App.ccPrueba.commands[0].disabled = false; App.gpDefault.reconfigure();" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="btnDisableRow" Text="Disable Row 2" runat="server">
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <ColumnModel>
                    <Columns>
                        <ext:Column ID="cColumna1" runat="server" DataIndex="Column1" Text="Column1" />
                        <ext:Column ID="cColumna2" runat="server" DataIndex="Column2" Text="Column2" />
                        <ext:CommandColumn
                            ID="ccPrueba"
                            runat="server">
                            <Commands>
                                <ext:GridCommand CommandName="Test1" Icon="Accept" />
                                <ext:GridCommand CommandName="Test2" Icon="Add" />
                            </Commands>
                        </ext:CommandColumn>
                    </Columns>
                </ColumnModel>
            </ext:GridPanel>
    Attached Thumbnails Click image for larger version. 

Name:	GridCommand01.png 
Views:	6 
Size:	7.9 KB 
ID:	22371   Click image for larger version. 

Name:	GridCommand02.png 
Views:	7 
Size:	8.9 KB 
ID:	22381  
    Last edited by Daniil; Mar 17, 2015 at 1:50 PM. Reason: [CLOSED]
  2. #2
    Hi @osef,

    Please have a look at this example.
    https://examples2.ext.net/#/GridPane...repare_Toolbar
  3. #3
    Hi Daniil, but I want after load records with a Button, I want to be fully manipulable both GridCommands in any row to disable and enable.

    Thank you.
  4. #4
    You should still use a prepareToolbar. This Ext.NET v1 example demonstrates the idea.
    http://forums.ext.net/showthread.php...ll=1#post49623

    Instead of .refreshRow(record) you'll need to use .refreshNode(index).
    http://docs.sencha.com/extjs/4.2.1/#...od-refreshNode

Similar Threads

  1. Replies: 7
    Last Post: Jun 17, 2014, 10:14 AM
  2. [CLOSED] MVC - Command Column - GridCommand
    By thchuong in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Sep 25, 2013, 3:23 AM
  3. [CLOSED] Gridcommand replace Icon and disable command
    By sisa in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Apr 24, 2013, 12:55 PM
  4. [CLOSED] Disable GridCommand of a gridPanel on Command Click
    By otouri in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Apr 16, 2013, 1:43 PM
  5. Replies: 0
    Last Post: Jul 26, 2010, 9:09 AM

Tags for this Thread

Posting Permissions