[CLOSED] Get gridpanel column value from Javscript

  1. #1

    [CLOSED] Get gridpanel column value from Javscript

    Hello,

    I would like to get the column value from grid panel in javascript.

    But the record value is undefined. Please check the following code and error msg.

    Thank you.

    <script> 
    var checkEditableInvoiceID = function (value, metadata, record, rowIndex, colIndex, store) {
                alert(record.data.RECORD_STATUS);
            };
    
    </script>
    
    
    <Store>
                                                        <ext:Store ID="sTransaction" runat="server" OnSubmitData="SubmitData" PageSize="30" OnReadData="sTransaction_RefreshData" AutoLoad="false">
                                                            <Model>
                                                                <ext:Model ID="Model1" runat="server" Name="CategoryMaster">
                                                                    <Fields>
                                                                        <ext:ModelField Name="RECORD_STATUS" Type="String" />                                                                    
                                                                        <ext:ModelField Name="INVOICEID" Type="String" />                                                                    
                                                                    </Fields>
                                                                </ext:Model>
                                                            </Model>                                                        
                                                        </ext:Store>
                                                    </Store>
                                                    <ColumnModel ID="ColumnModel1" runat="server">
                                                        <Columns>
                                                            <ext:Column ID="RECORD_STATUS" runat="server" Text="RECORD STATUS" DataIndex="RECORD_STATUS" Visible="false">
                                                            </ext:Column>                                                        
                                                            <ext:Column ID="INVOICEID" runat="server" Text="Invoice No." DataIndex="INVOICEID" Width="100">                                                                  
                                                                <Editor>                                                             
    
                                                                    <ext:ComboBox ID="ddlInvoiceList" runat="server" EmptyText="Invoice No." DisplayField="INVOICEID" ValueField="INVOICEID" TypeAhead="false" HideBaseTrigger="true" TriggerAction="Query" MinChars="0" LabelWidth="120" Width="290">                                                                    
                                                                        <ListConfig LoadingText="Searching...">
                                                                            <ItemTpl ID="ItemTpl1" runat="server">
                                                                                <Html>
                                                                                    <div class="search-item">
                                                                                        {INVOICEID}
                                                                                    </div>
                                                                                </Html>
                                                                            </ItemTpl>
                                                                        </ListConfig>
                                                                        <Store>
                                                                            <ext:Store ID="sInvoiceList" runat="server" AutoLoad="false">
                                                                                <Proxy>
                                                                                    <ext:AjaxProxy Url="../HttpHandler/GetInvoiceIDListFromTransaction.ashx">
                                                                                        <ActionMethods Read="POST" />
                                                                                        <Reader>
                                                                                            <ext:JsonReader Root="InoviceIDList" TotalProperty="total" />
                                                                                        </Reader>
                                                                                    </ext:AjaxProxy>
                                                                                </Proxy>
                                                                                <Model>
                                                                                    <ext:Model ID="Model3" runat="server" IDProperty="INVOICEID">
                                                                                        <Fields>
                                                                                            <ext:ModelField Name="INVOICEID" Type="String"></ext:ModelField>
                                                                                        </Fields>
                                                                                    </ext:Model>
                                                                                </Model>
                                                                            </ext:Store>
                                                                        </Store>
                                                                        <SelectedItems>
                                                                            <ext:ListItem Index="0"></ext:ListItem>
                                                                        </SelectedItems>
                                                                        <Triggers>                                                                        
                                                                            <ext:FieldTrigger Icon="Search" Qtip="Click here to search Invoice." />
                                                                        </Triggers>
                                                                        <DirectEvents>
                                                                            <TriggerClick OnEvent="SearchTransactionDetails">                                                                           
                                                                                
                                                                                <ExtraParams>
                                                                                    <ext:Parameter Name="INVOICEID" Value="#{ddlInvoiceList}.getValue()" Encode="false" Mode="Raw"></ext:Parameter>
                                                                                </ExtraParams>                                                                            
                                                                            </TriggerClick>
                                                                            <SpecialKey Before="return e.getKey() == e.ENTER;" OnEvent="SearchTransactionDetails">
                                                                                <EventMask ShowMask="true" MinDelay="500" Msg="LOADING DATA..." />
                                                                            </SpecialKey>                                                                        
                                                                        </DirectEvents>                                                                   
                                                                    </ext:ComboBox>
                                                                </Editor>
                                                            </ext:Column>                                                       
                                                        </Columns>
                                                    </ColumnModel>                                               
                                                    <Plugins>
                                                        <ext:CellEditing ID="RowEdit" runat="server" ClicksToEdit="1">
                                                            <Listeners>                                                            
                                                                <BeforeEdit Fn="checkEditableInvoiceID">
                                                                </BeforeEdit>
                                                            </Listeners>
                                                        </ext:CellEditing>
                                                    </Plugins>
    Error: Unable to get value of the property 'RECORD_STATUS': object is null or undefined
    Last edited by Daniil; Aug 14, 2013 at 7:46 AM. Reason: [CLOSED]
  2. #2
    Solve it out already as follow:
    <Listeners>
                                                                     
                                                                <BeforeEdit Handler="if (e.record.get('RECORD_STATUS') != 'INSERT') { if(e.column.id == 'INVOICEID') {return false;}};"/>                                                            
                                                            </Listeners>

Similar Threads

  1. Replies: 0
    Last Post: Sep 27, 2012, 7:10 PM
  2. Replies: 3
    Last Post: Nov 10, 2011, 4:10 PM
  3. Replies: 1
    Last Post: Nov 04, 2011, 9:51 AM
  4. [CLOSED] Icon column in GridPanel based on column from store
    By jmcantrell in forum 1.x Premium Help
    Replies: 5
    Last Post: May 12, 2010, 6:46 PM
  5. Replies: 3
    Last Post: Apr 08, 2010, 8:16 AM

Posting Permissions