[CLOSED] Show hide a ImageCommandColumn AFTER the Grid Data are loaded

  1. #1

    [CLOSED] Show hide a ImageCommandColumn AFTER the Grid Data are loaded

    Hi all

    I got to Show an Icon in Grid representing a state. The state is provided after the grid data is loaded. I was thinking about a loop trough all records a receive with
      var records = store.getAllRange();
      var i = 0;
    
      while (i < records.length) {
      // --> get the ImageCommandColumn here and set her tho visible
    
        i++;
      }
    I can't find the way to grab the image command column :-(

    Any hint for this ?

    Peter
    Last edited by Daniil; Sep 02, 2014 at 1:11 PM. Reason: [CLOSED]
  2. #2
    Hi Peter,

    Please clarify does this not work?
    App.ImageCommandColumnId.show();
    App.ImageCommandColumnId.hide();
  3. #3
    nope... doesn't :-(

    To clarify the Code, here's my Grid Mark up

     <ext:GridPanel runat="server" ID="gridItem" AutoScroll="true">
          <ColumnModel>
            <Columns>
              <ext:CommandColumn ID="colEdit" runat="server" Width="120" Visible="False">
                <Commands>
                  <ext:GridCommand Icon="Delete" CommandName="cmdDelete" Text="Delete" />
                </Commands>
                <Listeners>
                  <Command Handler="handleItem(command, record);" />
                </Listeners>
              </ext:CommandColumn>
              <ext:Column ID="colId" runat="server" DataIndex="Id" Text="Id" Width="100" Hidden="True" Groupable="False" Sortable="False" MenuDisabled="True" />
              <ext:Column ID="colItemNumber" runat="server" DataIndex="ItemNumber" Align="Right"   Width="30" Groupable="true" Sortable="true" MenuDisabled="False" />
              <ext:Column ID="colDescription" runat="server" DataIndex="Description"   Width="200" Hidden="False" Groupable="true" Sortable="true" MenuDisabled="False" Flex="1" />
              <ext:NumberColumn ID="colNetMass" runat="server" DataIndex="NetMass" Align="Right"   Width="75" Hidden="False" Groupable="true" Sortable="true" MenuDisabled="False" Format="0.00" />
              <ext:NumberColumn ID="colGrossMass" runat="server" DataIndex="GrossMass" Align="Right"   Width="75" Hidden="False" Groupable="true" Sortable="true" MenuDisabled="False" Format="0.00" />
    
              <ext:ImageCommandColumn ID="colError" Width="30" runat="server"   ">
                <Commands>
                  <ext:ImageCommand Icon="Error" CommandName="cmdHasError" Hidden="true" />
                </Commands>
              </ext:ImageCommandColumn>
    
            </Columns>
          </ColumnModel>
    
          <SelectionModel>
            <ext:RowSelectionModel ID="RowSelectionModel" runat="server" Mode="Single" />
          </SelectionModel>
          <Listeners>
            <SelectionChange Handler="Ext.net.Mask.show({ msg : 'Loading...' });loadItemDetail(item, selected); " />
          </Listeners>
          <Store>
            <ext:Store ID="storeDeclarationItem" runat="server">
              <Model>
                <ext:Model ID="modelDeclarationItem" runat="server">
                  <Fields>
                    <ext:ModelField Name="Id" />
                    <ext:ModelField Name="ItemNumber" Type="Int" />
                    <ext:ModelField Name="Description" />
                    <ext:ModelField Name="NetMass" Type="Float" />
                    <ext:ModelField Name="GrossMass" Type="Float" />
                  </Fields>
                </ext:Model>
              </Model>
            </ext:Store>
          </Store>
          <Plugins>
            <ext:BufferedRenderer />
          </Plugins>
        </ext:GridPanel>
    The Error Checking is done by an async Method called after the Data loading. Therefore I need to set the Column 'colError' Visibility Record by Record...

    Thank's for the Help
    Peter
  4. #4
    Therefore I need to set the Column 'colError' Visibility Record by Record...
    You probably mean that you need to show the ImageCommand (not a column, but a command) for some rows and hide for others.

    I guess you should use an ImageCommandColumn's PrepareCommand. Please look at the example.
    https://examples2.ext.net/#/GridPane...pare_Commands/
    Last edited by Daniil; Aug 26, 2014 at 5:57 PM.

Similar Threads

  1. [CLOSED] Hide and show a container if no data
    By PriceRightHTML5team in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 13, 2013, 12:10 PM
  2. [CLOSED] Hide images in imagecommandcolumn based on contents of row
    By HansWapenaar in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 15, 2012, 10:07 AM
  3. Replies: 1
    Last Post: Dec 28, 2011, 6:36 PM
  4. [CLOSED] How to evoid show the record in a grid when the page is loaded?
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 30, 2010, 9:51 PM
  5. Replies: 2
    Last Post: Mar 04, 2009, 4:28 PM

Posting Permissions