U7中自定义Umbraco数据类型的多个值

时间:2015-01-05 13:18:18

标签: umbraco umbraco7

我希望在Umbraco 7中为自定义数据类型提供多行值(超过1个输入)。

目前,保存时会添加多行和数据,但添加5行后,保存时会出现以下错误:

Received an error from the server: 
String or binary data would be truncated. The statement has been terminated.
...

我已将清单设置为期望JSON数据(但之前未定义)。

有人知道我做错了什么或如何为自定义Umbraco 7数据类型保存大量数据吗?

清单

{
  propertyEditors: [
    {
      alias: "Test",
      name: "Test",
      editor: {
        view: "~/App_Plugins/Test/test.html",
        hideLabel: false,
        valueType: "JSON"   
      }
    }
  ],
  javascript: [
    "~/App_Plugins/Test/test.controller.js"
  ] 
}

视图

...
<tbody>
  <tr ng-repeat="value in model.value.list">
    <th>{{value.name}}</th>
    <td>{{value.size}}</td>
    <td>{{value.weight}}</td>
  </tr>
</tbody>
<tfoot>
  <tr>
    <th><input type="text" ng-model="addRowName" /></th>
    <td><input type="text" ng-model="addRowSize" /></td>
    <td>
      <input type="text" ng-model="addRowWeight" />
      <a ng-click="addRow()" href="">Add Row</a>
    </td>
  </tr>
</tfoot>
...

JS / Controller(addRow函数)

...
$scope.addRow = function() {
  $scope.model.value.list.push({
    name: $scope.addRowName,
    size: $scope.addRowSize,
    weight: $scope.addRowWeight
  });
};
...