Kendo UI グリッドで発生している問題について、さまざまな場所でヘルプを見つけようとしています。
私がやろうとしていること
私がやろうとしているのは、「LoadContentFrom」を使用してロードしたいタブストリップ内の2つの行にテンプレートを使用するサーバーバインドグリッドを使用して、オンデマンドロードを利用することです。それに加えて、グリッドに並べ替えを実装する必要があります。
私がすでに試したこと
これを実現するためにさまざまな方法を試しましたが、成功していません。この問題を一時的に解決するために、「コンテンツ」機能を使用してタブ ストリップにデータをロードしています。これの欠点は、すべてのタブ ストリップのすべてのデータがページの読み込み時に読み込まれることです。これにより、ページの読み込みが遅くなり、列ヘッダーをクリックして並べ替えるたびに、ページが更新されます。
まとめの質問
私の質問は、「LoadContentFrom」メソッドを使用するタブ ストリップを使用し、並べ替え可能なタブ ストリップの 1 つにサーバー バインド グリッドを配置することは可能ですか?
可能であれば、誰かがそれがどのように見えるかの例を教えてもらえますか?
私の開発環境
私は MVC 4 ベースのプロジェクトに取り組んでいます。プログラミング言語として VB.NET を使用しています。C# を使用して回答を提供する人には問題ありません。
私のコードは今どのように見えるか
以下は、私が今持っているコードの例です。
タブストリップコード
`@Imports CommericalPortal.BusinessData.Entities
@Imports CommericalPortal.Web.Models.Entities
@imports CommericalPortal.Web.My.Resources
@ModelType Customer
@Code
ViewBag.Settings.PageTitle = Model.OperatingName
Dim lastSavedTabIndex As Integer
If Request.Cookies("TabCustomersPolicySavedIndex") IsNot Nothing AndAlso IsNumeric(Request.Cookies("TabCustomersPolicySavedIndex").Value) Then
lastSavedTabIndex = CInt(Request.Cookies("TabCustomersPolicySavedIndex").Value)
Else
lastSavedTabIndex = 1
End If
End Code
@(Html.Kendo().TabStrip().Name("TabCustomers").SelectedIndex(lastSavedTabIndex) _
.Items(Sub(actions)
actions.Add().Text(TabText.ContactInfoTab).Content(Html.Action("ByLocation", "Contacts", New With {.asPartial = True}).ToHtmlString)
actions.Add().Text(TabText.PoliciesTab).Content(Html.Action("ByLocation", "Policies", New With {.asPartial = True}).ToHtmlString)
actions.Add().Text(TabText.InvoicesTab).Content(Html.Action("ByLocation", "Invoices", New With {.asPartial = True}).ToHtmlString)
actions.Add().Text(TabText.ClaimsTab).Content(Html.Action("ByLocation", "Claims", New With {.asPartial = True}).ToHtmlString)
actions.Add().Text(TabText.BillingTab).Content(Html.Action("ForCustomer", "Billing", New With {.asPartial = True}).ToHtmlString)
End Sub) _
.Events(Sub(x)
x.Select("onSelect")
End Sub)
)
<script>
function onSelect(e) {
SetupTabStripToRememberActiveTabBetweenPageCalls
("TabCustomers", "TabCustomersPolicySavedIndex");
}
</script>`
タブ ストリップ コンテンツ コード (グリッド)
`@ModelType ilist(of CommericalPortal.BusinessData.Entities.PACInformation)'
@imports CommericalPortal.Web
@(Html.Kendo.Grid(Model).Name("DisplayPAC") _
.Columns(Sub(columns)
columns.Bound(Function(model) model.AccountNumber).Title(CommericalPortal.BusinessData.Resources.BillingAndInvoices.PacAccountNumberLabel_ShortForm).Sortable(False)
columns.Bound(Function(model) model.BankNumber).Title(CommericalPortal.BusinessData.Resources.BillingAndInvoices.PacBankNumberLabel_ShortForm)
columns.Bound(Function(model) model.TransitNumber).Title(CommericalPortal.BusinessData.Resources.BillingAndInvoices.PacTransitNumberLabel_ShortForm)
columns.Bound(Function(model) model).Template(Function(obj) String.Format("<a href='{0}/{1}'>{2}</a>", Url.Content("~/PAC/Edit"), obj.ID, CommericalPortal.Web.My.Resources.GridText.EditLinkText)).Title("")
columns.Bound(Function(model) model).Template(Function(obj) String.Format("<a href='{0}/{1}'>{2}</a>", Url.Content("~/PAC/ViewCheques"), obj.ID, CommericalPortal.Web.My.Resources.GridText.ViewChequesLinkText)).Title("")
End Sub) _
.Sortable(Function(sorting) sorting.SortMode(GridSortMode.SingleColumn).Enabled(True))
)`