set formatPlaceholder in datepicker to null or empty

1 Answer 2196 Views
DatePicker
jan
Top achievements
Rank 1
Iron
jan asked on 13 Oct 2021, 08:45 AM

Hi,

I read about the formatPlaceholder option in the docs, but I can't find any options, whether we can set this value to null or an empty string. Currently my column filter is configured like this:


<kendo-grid-column field="year" title="Év" format="yyyy">
      <ng-template kendoGridFilterCellTemplate let-filter let-column="column">
        <kendo-grid-date-filter-cell
          [showOperators]="false"
          [column]="column"
          [filter]="filter"
          activeView="decade"
          bottomView="decade"
          format="yyyy"
          [formatPlaceholder]="{
            year: '',
            month: '',
            day: '',
            hour: '',
            minute: '',
            second: ''
          }"
        >
        </kendo-grid-date-filter-cell>
      </ng-template>
    </kendo-grid-column>

As you see, I tried to set the placeholder to nothing, but no success, I get this:

How can I get rid of the 'year' text?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Accepted
Hetali
Telerik team
answered on 14 Oct 2021, 03:41 PM

Hi Jan,

By assigning an empty string or null value to the year, the formatPlaceholder will show the default text i.e. 'year'. To remove the text 'year' from the formatPlaceholder, set it's value to a space. For example:

<kendo-grid-date-filter-cell
  [formatPlaceholder]="{year: ' '}"
>
</kendo-grid-date-filter-cell>

In this StackBlitz example, there is no placeholder in the DateFilterCellComponent of the Kendo UI Grid.

I hope this helps. Please let me know if I can further assist you.

Regards,
Hetali
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

jan
Top achievements
Rank 1
Iron
commented on 15 Oct 2021, 04:45 AM

Great, it worked! Thanks.
Tags
DatePicker
Asked by
jan
Top achievements
Rank 1
Iron
Answers by
Hetali
Telerik team
Share this question
or