[CLOSED] Calculate Field

  1. #1

    [CLOSED] Calculate Field

    Hi there,

    I would like to know if it's possible to show a calculated value in a column of a grid panel.

    I have the following situation:

    I have two grids in a page. The first one show an employees list and the second show many transactions associated with the employee selected in the first grid.

    I would like to have a second column in the first grid to show the total of the quantity field for all records of the second grid.

    Tank's

    Ray
  2. #2

    RE: [CLOSED] Calculate Field

    Hi,

    Are those grids using one store? Please provide that configuration. You can always to use column renderer (where you can perform required calculation ) or you can add RecordField and use Convert property (https://examples1.ext.net/#/GridPane.../Data_Prepare/)


    I will able to provide more details about implementation after posting those grids and store(s)
  3. #3

    RE: [CLOSED] Calculate Field

    Each grid use a different store.

    First grid :



    <ext:GridPanel ID="gridPanelEmployee" Border="false" runat="server" StoreID="employeStore">
    <ColumnModel>
    <Columns>
    <ext:HiddenColumn ColumnID="fieldId" DataIndex="Id" />
    <ext:Column ColumnID="fieldDisplayName" DataIndex="DisplayName" Header="<%$Resources:ResStr, ApprovalEmployeeInfoCol_DisplayName%>" />
    <ext:Column ColumnID="fieldEmail" DataIndex="Email" Header="<%$Resources:ResStr, ApprovalEmployeeInfoCol_Email%>" />
    <ext:Column ColumnID="FieldTotal" DataIndex="" Header="<%$Resources:ResStr, Common_Total%>" />
    </Columns>
    </ColumnModel>
    </ext:GridPanel>

    Second grid :




    <ext:GridPanel ID="gridPanelApproval" Border="false" runat="server" StoreID="approvalStore">
    <ColumnModel>
    <Columns>
    <ext:Column ColumnID="fieldApprovalLevel" DataIndex="ApprovalLevel" Header="<%$Resources:ResStr, ApprovalInfoCol_Level%>">
    </ext:Column>
    <ext:DecimalColumn ColumnID="fieldQuantity" DataIndex="Quantity" Header="<%$Resources:ResStr, ApprovalInfoCol_Quantity%>"
    </ext:CheckColumn>
    </Columns>
    </ColumnModel>
  4. #4

    RE: [CLOSED] Calculate Field

    Hi,

    I don't see why do you need calculated field in your scenario (just not sure what and how should be calculated).
    All of you need to add field to the first grid, that field contains count of the transaction and must be calculated on the server side for each employee.

    Can you explain how are you planning to calculate total of those transaction for each employee if second grid contains transaction for selected employee only (I assume that you rebind second store after the selection changing in the first grid)
  5. #5

    RE: [CLOSED] Calculate Field

    Sorry for the delay,

    I used a different way to show the quantity totals value and all work's fine.

    Thank you

    Ray

Similar Threads

  1. Replies: 2
    Last Post: Aug 19, 2011, 1:36 PM
  2. calculate value
    By oseqat in forum 1.x Help
    Replies: 5
    Last Post: Jul 26, 2011, 1:23 PM
  3. Replies: 2
    Last Post: Feb 17, 2010, 9:47 AM
  4. [CLOSED] How to accurately calculate time to render Grid
    By bsnezw in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Dec 17, 2009, 2:19 PM
  5. Calculate Totals in GridPanel
    By simonmicheal in forum 1.x Help
    Replies: 1
    Last Post: Aug 01, 2009, 3:39 PM

Posting Permissions