Reputation: 125
I want multiple rows of values (more than 1 input) for a custom datatype in Umbraco 7.
Currently, multiple rows and data are being added when saved, but after adding 5 rows I get the following error when saving:
Received an error from the server:
String or binary data would be truncated. The statement has been terminated.
...
I have set the manifest to expect JSON data (however it was previously undefined).
Does anybody know what I have done wrong or how to save large amounts of data for a custom Umbraco 7 datatype?
{
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>
...
...
$scope.addRow = function() {
$scope.model.value.list.push({
name: $scope.addRowName,
size: $scope.addRowSize,
weight: $scope.addRowWeight
});
};
...
Upvotes: 0
Views: 1614
Reputation: 263
I've run into the same issue. Have a look here for the solution: http://our.umbraco.org/forum/umbraco-7/developing-umbraco-7-packages/59997-String-or-binary-data-would-be-truncated-with-custom-property-editor?p=0#comment203294
Upvotes: 2