0

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?

Manifest

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

View

...
<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 function)

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

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

Exactly right! I recreated the datatype in Umbraco after I added the valueType to the manifest. Fantastic.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.