ProgressNS / nativescript-ui-feedback

This repository is used for customer feedback regarding Telerik UI for NativeScript. The issues system here is used by customers who want to submit their feature requests or vote for existing ones.
Other
115 stars 21 forks source link

[DataForm] unable to create editor of type DatePicker or TimePicker, while using metadata #218

Closed tsonevn closed 6 years ago

tsonevn commented 7 years ago

An issue while generating editor of type DatePicker or TimePicker, while using metadata. For example: HTML

<RadDataForm tkExampleTitle tkToggleNavButton  #myDataForm [source]="person" [metadata]="personMetadata"></RadDataForm>

Typescript

this.person={
    "name": "John",
    "age": 23,
    "email": "john@company.com",
    "city1": "New York",
    "street": "5th Avenue",
    "streetNumber": 11,
    "datefield":"2016-05-06"
    }
this.personMetadata = {
  "isReadOnly": false,
  "commitMode": "immediate",
  "validationMode": "immediate",
  "propertyAnnotations":
  [
    {
      "name": "name",
      "displayName": "Name",
      "groupName": "Main"
    },
    {
      "name": "age",
      "displayName": "Age",
      "editor": "Number",
      "groupName": "Main"
    },
    {
      "name": "email",
      "displayName": "E-Mail",
      "editor": "Email",
      "groupName": "Main"
    },
    {
      "name": "city1",
      "displayName": "City1",
      "editor": "Picker",
      "valuesProvider": ["New York", "Test", "Los Angeles"],
      "groupName": "Main2"
    },
    {
      "name": "street",
      "displayName": "Street Name",
      "groupName": "Main2"
    },
    {
      "name": "streetNumber",
      "displayName": "Street Number",
      "editor": "Number",
      "groupName": "Main2"
    },
    {
        "name": "datefield",
      "displayName": "datefield",
      "editor": "DatePicker",
      "groupName": "Main"
    }
  ]
}

Error:

-[__NSCFString isEqualToDate:]: unrecognized selector sent to instance 0x600000a46240
maatthc commented 6 years ago

A workaround is to repete the DatePicker on the HMTL, like here : https://github.com/maatthc/ns_dataform

zbranzov commented 6 years ago

The fix is released in nativescript-ui-dataform@3.8.