-
Notifications
You must be signed in to change notification settings - Fork 0
/
Viewer.cshtml
23 lines (22 loc) · 1.05 KB
/
Viewer.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<script type="text/html" id="custom-parameter-text-editor">
<div data-bind="dxTextBox: getOptions({ value: value, disabled: disabled }),
dxValidator: { validationRules: $data.validationRules || [] }"></div>
</script>
<script type="text/javascript">
function customizeParameterEditors(s, e) {
if (e.parameter.type ===
"@typeof(CustomParameterEditorAspNetMvcExample.CustomParameterType).FullName") {
if(!e.parameter.multiValue && !e.parameter.hasLookUpValues) {
e.info.validationRules = e.info.validationRules || [];
e.info.validationRules.push(
{ type: 'email', message: 'Email parameter value has invalid format.' });
e.info.editor = { header: "custom-parameter-text-editor" };
}
}
}
</script>
@Html.DevExpress().WebDocumentViewer(settings =>
{
settings.Name = "WebDocumentViewer1";
settings.ClientSideEvents.CustomizeParameterEditors = "customizeParameterEditors";
}).Bind("CustomReport").GetHtml()