[0.8.1] Renderer bug

  1. #1

    [0.8.1] Renderer bug

    Hi,

    I have been reading on the net, and I see that ExtJs has a delay field por the renderer, and we dont get it on coolite.

    What's going on is when I select my rows on client side, I cant get the first row selected since the grid is still rendering.

    You need to use 40+ rows.

    Any help would be appreciated.

    Thanks,

            var renderVeiculo = function (value, metadata, record, rowIndex, colIndex, store){
    
                if (record.data.RVR_IND_DECISAO == 0) {
                  <%= GridPanelVeiculo.ClientID %>.getSelectionModel().selectRow(rowIndex);       
                }
                
                return value;
            }
    
     <ext:Store ID="StoreVeiculo" runat="server">
            <Reader>
                <ext:JsonReader ReaderID="NURENAVAM">
                    <Fields>
                        <ext:RecordField Name="NURENAVAM" />
                        <ext:RecordField Name="DSPLACAVEICULO" />
                        <ext:RecordField Name="DSMARCAMODELO" />
                        <ext:RecordField Name="DSANOFRABRICACAO" />
                        <ext:RecordField Name="RVR_RTB_NUM_BENEFICIO" />
                        <ext:RecordField Name="RVR_IND_DECISAO" />
                        <%--Se está selecionado--%>
                    </Fields>
                </ext:JsonReader>
            </Reader>
      </ext:Store>
    
    <ext:GridPanel AutoHeight="true" AutoExpandColumn="dsMarcaModelo" ID="GridPanelVeiculo"
                                    runat="server" StoreID="StoreVeiculo" StripeRows="true">
                                    <ColumnModel runat="server">
                                        <Columns>
                                            <ext:Column Header="Renavam" Sortable="true" DataIndex="NURENAVAM">
                                            </ext:Column>
                                            <ext:Column Header="Placa" Sortable="true" DataIndex="DSPLACAVEICULO" />
                                            <ext:Column ColumnID="dsMarcaModelo" Header="Modelo" Sortable="true" DataIndex="DSMARCAMODELO" />
                                            <ext:Column Header="Ano fabricação" Sortable="true" DataIndex="DSANOFRABRICACAO">
                                                <Renderer Fn="renderVeiculo" />
                                            </ext:Column>
                                        </Columns>
                                    </ColumnModel>
                                    <SelectionModel>
                                        <ext:CheckboxSelectionModel ID="SelectionModelVeiculo" runat="server" />
                                    </SelectionModel>
                                    <BottomBar>
                                        <ext:PagingToolbar runat="server" PageSize="10" />
                                    </BottomBar>
                                </ext:GridPanel>
  2. #2

    RE: [0.8.1] Renderer bug

    Hi,

    Please provide link where did you see that renderer has delay. Listeners only have delay.


    Renderer cannot has the delay because it should return value immedeiately.
    If you need to set predefined selection then use SelectedRows collection
    https://examples1.ext.net/#/GridPane...Row_Selection/
  3. #3

    RE: [0.8.1] Renderer bug

    I had to change to server side, since client side aint working.

    This is where i found the code with the delay.

    http://www.extjs.com/forum/showthread.php?t=41362

    Please, try the client side rendering, it aint working properly. The first row is not being selected.

    Thanks

  4. #4

    RE: [0.8.1] Renderer bug

    Hi,

    In that post delay is used for Render event (not grid column renderer). As mentioned in that thread you have to set selection in the Store's Load event (when data is loaded)
  5. #5

    RE: [0.8.1] Renderer bug

    Hi,

    I tried as you said, still the selectrow on client side is not working.

    Please, have it a try.

    
    
    
    <ext:Store ID="StoreVeiculo" runat="server">
    
    
    <Listeners>
    
    
    <Load Delay="1000" />
    
    
    </Listeners>
    
    
    <Reader>
  6. #6

    RE: [0.8.1] Renderer bug

    Hi,

    You did not define handler for Load event
    Load Handler="#{GridPanel1}.getSelectionModel().selectRow(0);" Delay="100"/>
  7. #7

    RE: [0.8.1] Renderer bug

    It finally worked! Thanks for your help

    the final code

    Comments: Since the current ext version in use doesnt support Ext.partition, i had to use a workaround to filter.

    
    
    
    <Load Handler="#{GridPanelVeiculo}.getSelectionModel().selectRecords(#{StoreVeiculo}.query('RVR_IND_DECISAO', 0).getRange());"
    
    
    Delay="100" />

Similar Threads

  1. CommandColumn renderer
    By Mr Frogg in forum 1.x Help
    Replies: 5
    Last Post: Jan 26, 2010, 5:38 AM
  2. [0.8.2] CommandColumn and Renderer
    By SouthDeveloper in forum Bugs
    Replies: 4
    Last Post: Jan 20, 2010, 3:54 PM
  3. Gridpanel Row Renderer
    By DasPhansom in forum 1.x Help
    Replies: 5
    Last Post: Jul 20, 2009, 6:49 AM
  4. Colum renderer
    By Filip Beunens in forum 1.x Help
    Replies: 6
    Last Post: Mar 31, 2009, 1:41 PM
  5. Rowexpander renderer
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 21, 2008, 4:29 AM

Posting Permissions