LoadOnDemandがtrueに設定されている場合にigTreeを使用するには、いくつかの助けが必要です。igTreeに入力するデータを提供するWCFRESTサービスがあります。
サンプルコードを見つけてください。
$.ajax(
{
type: "GET",
url: "AssessmentProcWCFService.svc/GetAllEntities",
contentType: "application/json; charset=utf-8",
dataType: 'json',
data: '{}',
cache: false,
success: OnGetAllEntitiesSuccess,
error: OnGetAllEntitiesFailure
});
==================================================
function OnGetAllEntitiesSuccess(categoryList) {
$("#APTreeView").igTree({
animationDuration: 0,
dataSourceType: 'json',
dataSource: categoryList.d,
initialExpandDepth: false,
loadOnDemand: true,
dataSourceUrl: "AssessmentProcWCFService.svc/GetAllCategories?EntityID=primaryKey:id",
bindings: {
textKey: 'text',
valueKey: 'id',
primaryKey: 'id',
expanded: 'expanded',
childDataProperty: 'children'
}
});
}
================================================== =======
質問:-
ツリーのいずれかのノードが拡張しているときに、選択したノードIDをサービスに送信するにはどうすればよいですか?上記の例で送信している方法は、「string entityID = HttpContext.Current.Request.QueryString ["EntityID"];」のようなサービス「publicListGetAllCategories()」で取得しているときに機能しません。エンティティIDをnullとして取得しています。
LoadOnDemandがtrueの場合、ノードが展開されたときにツリーはどのようにレンダリングされますか?
私はそれに多くの時間を費やしてきたこれについて私を助けてください。