Class GridValidationBuilder

GridValidationBuilder

适用于 GridValidation 的 DataValidationBuilder。

// Add a grid item to a form and require one response per column.
var gridItem = form.addGridItem();
gridItem.setTitle('Rate your interests')
  .setRows(['Cars', 'Computers', 'Celebrities'])
  .setColumns(['Boring', 'So-so', 'Interesting']);
var gridValidation = FormApp.createGridValidation()
  .setHelpText(“Select one item per column.”)
  .requireLimitOneResponsePerColumn()
  .build();
gridItem.setValidation(gridValidation);

方法

方法返回类型简介
requireLimitOneResponsePerColumn()GridValidationBuilder要求网格项的每列只能有一个响应。

详细文档

requireLimitOneResponsePerColumn()

要求网格项的每列只能有一个响应。

返回

GridValidationBuilder - 此验证构建器,用于串联