url: "/" + domainUniqueName + "/basic/Resource/GetCatalogRoot",
onClick: function (node) {
clicknode(node);
},
onLoadSuccess: function (node, data) {
// window.console.log("load success")
// $("#unitPId").combotree('loadData',$('#tt').tree('getRoots')) ;
},
onBeforeExpand: function (node) {
var children = $('#cata_tree').tree('getChildren', node.target);
if (children[0].id == -1) {
$('#cata_tree').tree('remove', children[0].target);
$.ajax({
type: "post",
async: false,
url: "/" + domainUniqueName + "/basic/Resource/GetCatalogChildren",
data: { parentGuid: node.id, level: 1 },
success: function (data) {
$('#cata_tree').tree('append', {
parent: (node ? node.target : null),
data: data
});
}
});
}
}
});
$('#cata_p_guid').combotree({
url: "/" + domainUniqueName + "/basic/Resource/GetCatalogRoot",
width: 154,
onClick: function (node) {
parentNode = node;
},
onLoadSuccess: function () {
var tr = $('#cata_p_guid').combotree('tree');
var node = tr.tree("getRoot");
if (node) {
$('#cata_p_guid').combotree('setValue', node.id);
}
},
onBeforeExpand: function (node) {
var tr = $('#cata_p_guid').combotree('tree');
var children = tr.tree('getChildren', node.target);
if (children[0].id == -1) {
tr.tree('remove', children[0].target);
$.ajax({
type: "post",
async: false,
url: "/" + domainUniqueName + "/basic/Resource/GetCatalogChildren",
data: { parentGuid: node.id, level: 1 },
success: function (data) {
tr.tree('append', {
parent: (node ? node.target : null),
data: data
});
}
});
}
}
});
title: '未分配的资源',
iconCls: 'icon-save',
height: 360, width: 709,
rownumbers: true,
striped: true,
idField: 'Guid',
url: "/" + domainUniqueName + "/basic/Resource/GetUnbindResources",
queryParams: params,
columns: [[
{ field: 'ck', checkbox: true },
{ field: 'Title', title: '标题', width: 100, formatter: unbindLink },
{ field: 'Teacher', title: '主讲人', width: 60 },
{ field: 'FromDomainName', title: '来源', width: 80 },
{ field: 'SubjectName', title: '学科', width: 50 },
{ field: 'GradeName', title: '年级', width: 80 },
{ field: 'TypeCode', title: '类型', width: 60, formatter: resType },
{ field: 'Description', title: '描述', width: 80 }
]],
pagination: true,
onLoadSuccess: function () {
},
loadFilter: function (data) {
if (data.Success) {
return data.Data;
} else {
alert(data.Message);
}
}
});
var flag = false;
var resGuids = "";
for (var i = 0; i < rows.length; i++) {
if (flag) {
resGuids += ',';
}
resGuids += rows[i].Guid;
flag = true;
}