Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Moran 285 posts 934 karma points
    Dec 10, 2013 @ 12:52
    Moran
    0

    uComponents 6.0 Data grid

    I am trying to output a data grid to my razor template, I can render the table just fine as a macrosript but I would very much like to render it in my template as is in MVC scheme and not to use a macro for it.

    the macro code:

    @using umbraco.MacroEngines
    @inherits umbraco.MacroEngines.DynamicNodeContext
    @{
        <table>
            <tr>
                <th>Date</th>
                <th>Serial</th>
            </tr>
            @foreach (var row in Model.serialNumbersTable)
            {
                <tr>
                    <td>@row.issueDate</td>
                    <td>@row.serialNumber</td>
                </tr>
            }
        </table>
    }
    

    I am using umbraco version 6.1.6

  • Moran 285 posts 934 karma points
    Dec 11, 2013 @ 17:59
    Moran
    0

    Any ideas? is it possible?

  • Moran 285 posts 934 karma points
    Dec 14, 2013 @ 15:39
    Moran
    100

    Got it using currentPage

    <table>
            <tr>
                <th>@Umbraco.GetDictionaryValue("IssueDate")</th>
                <th>@Umbraco.GetDictionaryValue("ExpireDate")</th>
                <th>@Umbraco.GetDictionaryValue("SerialNumber")</th>
            </tr>
            @foreach (var row in CurrentPage.serialNumbersTable)
            {
                <tr>
                    <td>@row.serialNumber</td>
                    <td>@row.issueDate</td>
                    <td>@row.expireDate</td>
                </tr>
            }
    
    </table>
    
Please Sign in or register to post replies

Write your reply to:

Draft