好的,所以我使用的是MVCCONTRIB网格,试图覆盖一行的开始和一行的结尾。它无法正常工作。我可以合理地确定这是我做愚蠢的事情。

这是我MVC2.0视图的摘录。

<div id="chargestable">
<br />
<%  With Html.Grid(Model.InvoiceListingInformation)
        .Columns(Function(column)
                     column.For(Function(setColumns) setColumns.InvoiceNumber)
                     column.For(Function(setColumns) setColumns.InvoiceDate)
                     column.For(Function(setColumns) setColumns.ExclGST)
                     column.For(Function(setColumns) setColumns.InclGST)
                 End Function)
        .RowStart(Function(pRowStart) "Some extra text here <tr>")
        .RowEnd(Function(pRowEnd) "</tr>")
        .Render()

    End With
   %>
</div>

这是由此产生的HTML ...非常奇怪:

<div id="chargestable">
    <br>
    Some extra text here text/Some extra text here Some extra text here text/Some extra text here Some extra text here text/Some extra text here Some extra text here text/Some extra text here Some extra text here text/Some extra text here Some extra text here text/Some extra text here 
<table class="grid">
<thead>
<tr><th>Invoice Number</th><th>Invoice Date</th><th>Excl G S T</th><th>Incl G S T</th></tr>
</thead>
<tbody>
<tr><td>x</td><td>13/12/2009 12:00:00 AM</td><td>amnt</td><td>amnt</td></tr>
<tr><td>y</td><td>15/11/2009 12:00:00 AM</td><td>amnt</td><td>amnt</td></tr>
<tr><td>z</td><td>13/10/2009 12:00:00 AM</td><td>amnt</td><td>amnt</td></tr>
<tr><td>a</td><td>13/09/2009 12:00:00 AM</td><td>amnt</td><td>amnt</td></tr>
<tr><td>b</td><td>13/08/2009 12:00:00 AM</td><td>amnt</td><td>amnt</td></tr>
<tr><td>c</td><td>12/07/2009 12:00:00 AM</td><td>amnt</td><td>amnt</td></tr>
<tr><td>d</td><td>13/06/2009 12:00:00 AM</td><td>amnt</td><td>amnt</td></tr>
<tr><td>e</td><td>13/05/2009 12:00:00 AM</td><td>amnt</td><td>amnt</td></tr>
</tbody>
</table>
</div>

我放在开始行和结束行函数中的内容完全在网格上方渲染。什么?我一直在这个小时里打我的头几个小时,任何人都可以看到我做错了什么?

(ps我不仅可以使用属性,因为我需要将行包裹在另一个HTML元素中)

问候,詹姆斯

有帮助吗?

解决方案

我尝试做您所做的事情,生成的HTML是:

...
<tbody>
Some extra text here <tr>...</tr>
Some extra text here <tr>...</tr>
...

但是额外的文字全部 渲染 在网格的顶部,大概是因为它不包含在任何子元素中。

要测试发生的事情,您可以尝试:

 .RowStart(Function(pRowStart) "<tr>extra row here</tr><tr>")

但是,我不确定您实际上是否可以将其包裹在另一个HTML元素中,至少在您想要有效的HTML时。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top