'Invalid template' error for kendo grid inside kendo tabstrip
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I wanted to place kendo grid inside kendo tabstrip content. It gave 'Invalid template' error. If I remove only kendo grid inside purchase tab, it works without error. Is there a workaround for this ?
<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> 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> 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> New Cost</a>
</text>);
}).ToClientTemplate())
</script>
asp.net-mvc kendo-grid kendo-template kendo-tabstrip
add a comment |
I wanted to place kendo grid inside kendo tabstrip content. It gave 'Invalid template' error. If I remove only kendo grid inside purchase tab, it works without error. Is there a workaround for this ?
<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> 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> 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> New Cost</a>
</text>);
}).ToClientTemplate())
</script>
asp.net-mvc kendo-grid kendo-template kendo-tabstrip
add a comment |
I wanted to place kendo grid inside kendo tabstrip content. It gave 'Invalid template' error. If I remove only kendo grid inside purchase tab, it works without error. Is there a workaround for this ?
<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> 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> 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> New Cost</a>
</text>);
}).ToClientTemplate())
</script>
asp.net-mvc kendo-grid kendo-template kendo-tabstrip
I wanted to place kendo grid inside kendo tabstrip content. It gave 'Invalid template' error. If I remove only kendo grid inside purchase tab, it works without error. Is there a workaround for this ?
<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> 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> 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> New Cost</a>
</text>);
}).ToClientTemplate())
</script>
asp.net-mvc kendo-grid kendo-template kendo-tabstrip
asp.net-mvc kendo-grid kendo-template kendo-tabstrip
edited Nov 18 '18 at 7:27
serefbilge
asked Nov 16 '18 at 20:34
serefbilgeserefbilge
99142150
99142150
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Your TabStrip already is in a template. If I am not mistaken, you have to escape every single # within the TabStrip's items. Like .Name("grid-purchase_\#=Id\#").
hmm, how I missed that, thanks @CarstenFranke. I preserved.Name("grid-purchase_#=Id#"), but I changed every other single#inside grid columns with\#, then it worked.
– serefbilge
Nov 19 '18 at 10:32
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53345008%2finvalid-template-error-for-kendo-grid-inside-kendo-tabstrip%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Your TabStrip already is in a template. If I am not mistaken, you have to escape every single # within the TabStrip's items. Like .Name("grid-purchase_\#=Id\#").
hmm, how I missed that, thanks @CarstenFranke. I preserved.Name("grid-purchase_#=Id#"), but I changed every other single#inside grid columns with\#, then it worked.
– serefbilge
Nov 19 '18 at 10:32
add a comment |
Your TabStrip already is in a template. If I am not mistaken, you have to escape every single # within the TabStrip's items. Like .Name("grid-purchase_\#=Id\#").
hmm, how I missed that, thanks @CarstenFranke. I preserved.Name("grid-purchase_#=Id#"), but I changed every other single#inside grid columns with\#, then it worked.
– serefbilge
Nov 19 '18 at 10:32
add a comment |
Your TabStrip already is in a template. If I am not mistaken, you have to escape every single # within the TabStrip's items. Like .Name("grid-purchase_\#=Id\#").
Your TabStrip already is in a template. If I am not mistaken, you have to escape every single # within the TabStrip's items. Like .Name("grid-purchase_\#=Id\#").
answered Nov 19 '18 at 10:27
Carsten FrankeCarsten Franke
9591523
9591523
hmm, how I missed that, thanks @CarstenFranke. I preserved.Name("grid-purchase_#=Id#"), but I changed every other single#inside grid columns with\#, then it worked.
– serefbilge
Nov 19 '18 at 10:32
add a comment |
hmm, how I missed that, thanks @CarstenFranke. I preserved.Name("grid-purchase_#=Id#"), but I changed every other single#inside grid columns with\#, then it worked.
– serefbilge
Nov 19 '18 at 10:32
hmm, how I missed that, thanks @CarstenFranke. I preserved
.Name("grid-purchase_#=Id#") , but I changed every other single # inside grid columns with \#, then it worked.– serefbilge
Nov 19 '18 at 10:32
hmm, how I missed that, thanks @CarstenFranke. I preserved
.Name("grid-purchase_#=Id#") , but I changed every other single # inside grid columns with \#, then it worked.– serefbilge
Nov 19 '18 at 10:32
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53345008%2finvalid-template-error-for-kendo-grid-inside-kendo-tabstrip%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown