官网例子:
//add order table
var orderTable = dataManager.addTable("orderTable", {
remote: {
read: {
url: baseApiUrl + "/Order"
}
}
});
//add customer table
var customerTable = dataManager.addTable("customerTable", {
remote: {
read: {
url: baseApiUrl + "/Customer"
}
}
});
//add relationship between order table and customer table
dataManager.addRelationship(orderTable, "CustomerId", "customer", customerTable, "Id", "orders");
API说明:
addRelationship(sourceTable, sourceFieldName, sourceRelationshipName, targetTable, targetFieldName, targetRelationshipName)[color=gray !important][backcolor=transparent !important][size=0.7em]{Object}
将关系添加到数据管理器中
Name Type Description
sourceTableGC.Data.Table源表,其中外键是目标表的主键
sourceFieldNamestring源字段名称
sourceRelationshipNamestring源关系名称
targetTableGC.Data.Table目标表,其主键是源表的外键
targetFieldNamestring目标字段名
targetRelationshipNamestring目标关系名称 addRelationship函数中,customer,orders这两个sourceRelationshipName、targetRelationshipName参数是怎么定义的?请详细说明一下,在官网例子中可以找到customer,但是orders找不到 { value: "customer", width: 350, style: multiSelectStyle },
|