Sample form
[{ "name": "Custom field 1", "type": "template", "template": "<div class='form-group'><label class='control-label col-md-4' for='{{form.id}}'>{{form.name}}</label><div class='col-md-8'><input type='text' sf-field-model schema-validate='form' class='form-control input-md' id='{{form.id}}' name='{{form.id}}' placeholder='{{form.placeholder}}'></div></div>", "key": "custom_field_1", "id": "custom_field_1", "placeholder": "your custom field 1", "feedback": false, "disableSuccessState": true, "disableErrorState": true } ]
Custom file form element structure
{ "name": "ID card", "key": "id_card", "id": "id_card", "type": "nwpFileUpload", "endpoint": "/web/admin/user/custom/file/{{user.personId}}?field_name=id_card", "i18n": { "add": "Open file browser", "preview": "Preview Upload", "filename": "File Name", "progress": "Progress Status", "upload": "Upload", "dragorclick": "Drag and drop your ID card image here" } }
Sample schema
{ "type": "object", "properties": { "custom_field_1": { "type": "template", "title": "Custom field 1" } } }
Custom file form element schema suructure
"id_card": { "title": "ID card image", "type": "array", "format": "singlefile", "x-schema-form": { "type": "array" }, "pattern": { "mimeType": "image/*", "validationMessage": "Wrong file type: " }, "maxSize": { "maximum": "1MB", "validationMessage": "File size is too large. Maximum allowed is 1MB" }, "maxItems": { "validationMessage": "One file is allowed to upload" }, "minItems": { "validationMessage": "Select image to upload" } }
key
is the field bind to datagrid "field" value.Sample form
[{ "name": "Custom field 1", "type": "template", "template": "<div class='form-group'><label class='control-label col-md-4' for='{{form.id}}'>{{form.name}}</label><div class='col-md-8'><input type='text' sf-field-model schema-validate='form' class='form-control input-md' id='{{form.id}}' name='{{form.id}}' placeholder='{{form.placeholder}}'></div></div>", "key": "custom_field_1", "id": "custom_field_1", "placeholder": "your custom field 1", "feedback": false, "disableSuccessState": true, "disableErrorState": true } ]
Custom file form element structure
{ "name": "ID card", "key": "id_card", "id": "id_card", "type": "nwpFileUpload", "endpoint": "/web/admin/user/custom/file/{{user.personId}}?field_name=id_card", "i18n": { "add": "Open file browser", "preview": "Preview Upload", "filename": "File Name", "progress": "Progress Status", "upload": "Upload", "dragorclick": "Drag and drop your ID card image here" } }
Sample schema
{ "type": "object", "properties": { "custom_field_1": { "type": "template", "title": "Custom field 1" } } }
Custom file form element schema suructure
"id_card": { "title": "ID card image", "type": "array", "format": "singlefile", "x-schema-form": { "type": "array" }, "pattern": { "mimeType": "image/*", "validationMessage": "Wrong file type: " }, "maxSize": { "maximum": "1MB", "validationMessage": "File size is too large. Maximum allowed is 1MB" }, "maxItems": { "validationMessage": "One file is allowed to upload" }, "minItems": { "validationMessage": "Select image to upload" } }
key
is the field bind to datagrid "field" value.Sample form
[{ "name": "Custom field 1", "type": "template", "template": "<div class='row form-group col-md-12 col-sm-12'><label class='control-label col-md-4' for='{{form.id}}'>{{form.name}}</label><div class='col-md-8 input-group'><input type='text' sf-field-model schema-validate='form' class='form-control input-md' id='{{form.id}}' name='{{form.id}}' placeholder='{{form.placeholder}}'></div></div>", "key": "custom_field_1", "id": "custom_field_1", "placeholder": "your custom field 1", "feedback": false, "disableSuccessState": true, "disableErrorState": true } ]
Sample schema
{ "type": "object", "properties": { "custom_field_1": { "type": "template", "title": "Custom field 1" } } }
key
is the field bind to datagrid "field" value.Sample form
[{ "name": "Custom field 1", "type": "template", "template": "<div class='row form-group col-md-12 col-sm-12'><label class='control-label col-md-4' for='{{form.id}}'>{{form.name}}</label><div class='col-md-8 input-group'><input type='text' sf-field-model schema-validate='form' class='form-control input-md' id='{{form.id}}' name='{{form.id}}' placeholder='{{form.placeholder}}'></div></div>", "key": "custom_field_1", "id": "custom_field_1", "placeholder": "your custom field 1", "feedback": false, "disableSuccessState": true, "disableErrorState": true } ]
Sample schema
{ "type": "object", "properties": { "custom_field_1": { "type": "template", "title": "Custom field 1" } } }
key
is the field bind to datagrid "field" value.Sample form
[{ "name": "Custom field 1", "type": "template", "template": "<div class=''><label class='control-label col-md-4' for='{{form.id}}'>{{form.name}}</label><div class='col-md-8'><input type='text' sf-field-model schema-validate='form' class='form-control input-md' id='{{form.id}}' name='{{form.id}}' placeholder='{{form.placeholder}}'></div></div>", "key": "custom_field_1", "id": "custom_field_1", "placeholder": "your custom field 1", "feedback": false, "disableSuccessState": true, "disableErrorState": true } ]
Sample schema
{ "type": "object", "properties": { "custom_field_1": { "type": "template", "title": "Custom field 1" } } }
key
is the field bind to datagrid "field" value.Sample calculated data
/** customColumnDefs.workhour: [] customColumnDefs.productivity: [] customColumnDefs.summary: [] customColumnDefs.users: [] customColumnDefs.events: [] customColumnDefs.arrival: [] customColumnDefs.departure: [] customColumnDefs.absentee: [] */ { "workhour:[{ "colName": "payAmount", "displayName": "Salary", "expression": "(data[i].reports[j].workHours / 3600) * $scope.getCustomDataValByKey( data[i].reports[j].customdata, 'hourly_rate' * 0.98)", "type" : "number", "styleClass" : "right-align", "cellFilter" : "currency:'€'" }, { "colName": "taxAmount", "displayName": "Tax", "expression": "(data[i].reports[j].workHours / 3600) * $scope.getCustomDataValByKey( data[i].reports[j].customdata, 'hourly_rate' * 0.02)", "type" : "number", "styleClass" : "right-align", "cellFilter" : "currency:'€'" }], "productivity": [{ "colName": "payAmount", "displayName": "Salary", "expression": "(data[i].reports[j].workHours / 3600) * $scope.getCustomDataValByKey( data[i].reports[j].customdata, 'hourly_rate' * 0.98)", "type" : "number", "styleClass" : "right-align", "cellFilter" : "currency:'€'" }, { "colName": "taxAmount", "displayName": "Tax", "expression": "(data[i].reports[j].workHours / 3600) * $scope.getCustomDataValByKey( data[i].reports[j].customdata, 'hourly_rate' * 0.02)", "type" : "number", "styleClass" : "right-align", "cellFilter" : "currency:'€'" }] }
getCustomDataValByKey(obj, key)
, getCustomDataStringByKey(obj, key)
and getCustomDataDateByKey(obj, key)
functions
to use custom user data with appropriate format. Parameters are custom data object and the key to be search in there. If the key is present, it will return the formatted value. otherwise, return 0, or empty string.Sample form
[{ "name": "Custom field 1", "type": "template", "template": "<div class='row form-group col-md-12 col-sm-12'><label class='control-label col-md-4' for='{{form.id}}'>{{form.name}}</label><div class='col-md-8 input-group'><input type='text' sf-field-model schema-validate='form' class='form-control input-md' id='{{form.id}}' name='{{form.id}}' placeholder='{{form.placeholder}}'></div></div>", "key": "custom_field_1", "id": "custom_field_1", "placeholder": "your custom field 1", "feedback": false, "disableSuccessState": true, "disableErrorState": true }]
Sample schema
{ "type": "object", "properties": { "custom_field_1": { "type": "template", "title": "Custom field 1" } } }
key
is the field bind to datagrid "field" value.