1

I want to hyper-link a grid cell which take an argument?

<px:PXNumberEdit ID="edOpenTimeID" runat="server" DataField="OpenTimeID">
    <LinkCommand ActiveBehavior="True" Argument="OpenTimeID" Command="ViewOpenTime">
    </LinkCommand>
</px:PXNumberEdit>

I found something like that there but, it does not take an argument. Thanks a lot

Community
  • 1
  • 1
  • What kind of url you want to make? – Yuriy Zaletskyy Jan 28 '15 at 14:30
  • 1
    What do you want to do with this argument? When invoking your ViewOpenTime command, you will already have access to the current row of your grid, and from there you do whatever action or redirect you want. – Gabriel Feb 02 '15 at 14:39

1 Answers1

0

I not sure is it really what you want, but I propose you the following solution (this is part of my working project). 1. In grid declaration:

<Columns>
    <px:PXGridColumn DataField="IsNotCalculated" Width="1px" RenderEditorText="True" >
                    </px:PXGridColumn>
                     <px:PXGridColumn DataField="PRPayrollDetailID" Width="90px" LinkCommand="GotoPayslip">
                        <ValueItems MultiSelect="False">
                        </ValueItems>
                    </px:PXGridColumn>
  1. In graph I described the following:

    public PXAction GotoPayslip;

    [PXButton]
    [PXUIField(DisplayName = "Go to Payslip")]
    public virtual IEnumerable gotoPayslip(PXAdapter adapter)
    {
    if (PayRollsDetails.Current != null)
    {
    var graph = CreateInstance();
    graph.PaySlip.Current =
    graph.PaySlip.SearchPRPayrollDetails.payrollRefNbr>( PayRollsDetails.Current.PRPayrollDetailID,
    PayRollsDetails.Current.PayrollRefNbr);
    throw new PXRedirectRequiredException(graph, true, "");
    }
    return adapter.Get();
    }

If to summarize in simple words:
1. At grid syncposition = true.
2. At column set DataField and LincCommand.
3. At graph you'll need PXAction declaration and implementation, which will differ from each other by case.
4. You can read and use paramethers at graph.

Yuriy Zaletskyy
  • 4,983
  • 5
  • 34
  • 54