0

我想将剑道网格放在剑道标签条内容中。它给出了“无效模板”错误。如果我只删除购买选项卡内的剑道网格,它可以正常工作。有解决方法吗?

<script id="invoice-template" type="text/kendo-tmpl">
@(Html.Kendo().TabStrip()
    .Name("tabStrip_#=Id#") // Id -> TransportId
    .SelectedIndex(0)
    .Animation(animation => animation.Open(open => open.Fade(FadeDirection.In)))
    .Items(items =>
    {
            items.Add().Text("Commercial").Content(@<text>
                <a href="\\#" class="k-new-commercial k-link k-button" title="New Commercial"><i class="fa fa-document"></i>&nbsp;&nbsp;New Commercial</a>
            </text>);
            items.Add().Text("Purchase").Content(@<text>
                <a href="\\#" class="k-new-purchase k-link k-button" title="New Purchase"><i class="fa fa-document"></i>&nbsp;&nbsp;New Purchase</a>
                <br />
                @(Html.Kendo().Grid<PurchaseInvoiceView>()
                                .Name("grid-purchase_#=Id#")
                                .Columns(columns =>
                                {
                                                    columns.Bound(c => c.InvoiceDate).Title("Date").Width(50).ClientTemplate("#= kendo.toString(InvoiceDate,'dd-MM-yyyy')#");
                                                    columns.Bound(c => c.InvoiceNo).Title("Number").Width(50)
                                                        .Filterable(f => f.Extra(false).Cell(cell => cell.Operator("contains").ShowOperators(false)));
                                                    columns.Bound(c => c.Lot).Title("Lot").Width(40)
                                                        .Filterable(f => f.Extra(false).Cell(cell => cell.Operator("contains").ShowOperators(false)));
                                                    columns.Bound(c => c.Supplier).Title("Group Company").Width(70)
                                                        .Filterable(f => f.Extra(false).Cell(cell => cell.Operator("contains").ShowOperators(false)));
                                                    columns.Bound(o => o.Quantity).Title("Quantity").Width(40).ClientTemplate("#= floatToDouble(Quantity)#");
                                                    columns.Bound(o => o.InvoiceAmount).Title("Amount").Width(40).ClientTemplate("#= floatToMoney(InvoiceAmount)#");
                                                    columns.Bound(c => c.CurrencyAsString).Title("").Width(40);
                                                })
                                .Sortable()
                                .Selectable()
                                .Pageable(pageable => pageable
                                    .Refresh(true)
                                    .PageSizes(true)
                                    .ButtonCount(5))
                                .DataSource(dataSource => dataSource
                                    .Ajax()
                                    .Read(read => read.Action("GetListOfPurchaseInvoice", "PurchaseInvoice", new { Area = "ar", transportId = "#=Id#" }))
                                    .PageSize(200)
                                ).ToClientTemplate())
            </text>);
            items.Add().Text("Cost").Content(@<text>
                <a href="\\#" class="k-new-cost k-link k-button" title="New Cost"><i class="fa fa-document"></i>&nbsp;&nbsp;New Cost</a>
            </text>);
    }).ToClientTemplate())
</script>
4

1 回答 1

1

您的 TabStrip 已经在模板中。如果我没记错的话,您必须转义#TabStrip 中的每一个items. 喜欢.Name("grid-purchase_\\#=Id\\#")

于 2018-11-19T10:27:35.240 回答