Skip to content

838227: empty record message change code added #4375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: hotfix/hotfix-v30.1.37
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public IActionResult Index()
{
ViewBag.DataSource = GanttData.ProjectNewData();
return View();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@Html.EJS().Gantt("Gantt").Height("450px").TaskFields(ts => ts.Id("TaskId").Name("TaskName").StartDate(
"StartDate").EndDate("EndDate").Duration("Duration").Progress("Progress").ParentID("ParentId")).Locale("de-DE").Render()

<script type="text/javascript">
ej.base.L10n.load({
'de-DE': {
'grid': {
"EmptyRecord": "Nothing to show here.",
}
}
});
ej.base.setCulture('de-DE');
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<ejs-gantt id='Gantt' height="450px" locale="de-DE">
<e-gantt-taskfields id="TaskId" name="TaskName" startDate="StartDate"
duration="Duration" progress="Progress" parentID="ParentId">
</e-gantt-taskfields>
</ejs-gantt>

<script type="text/javascript">
ej.base.L10n.load({
'de-DE': {
'grid': {
"EmptyRecord": "Nothing to show here.",
}
}
});
ej.base.setCulture('de-DE');
</script>
40 changes: 40 additions & 0 deletions ej2-asp-core-mvc/gantt/how-to/no-records-display.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
layout: post
title: Customize empty record message in ##Platform_Name## Gantt Component
description: Learn here all about Customize the empty data source message in Syncfusion ##Platform_Name## Gantt component of Syncfusion Essential JS 2 and more.
platform: ej2-asp-core-mvc
control: Customize the empty datasource message
publishingplatform: ##Platform_Name##
documentation: ug
---


# Customize the empty datasource message in Angular Gantt component

By default, the Gantt component displays the message "No records to display" when the data source is empty. However, you can customize this message using [`localization`](https://ej2.syncfusion.com/react/documentation/gantt/global-local#localization) to provide a more meaningful message.

The following code snippets demonstrate how to achieve this.

{% if page.publishingplatform == "aspnet-core" %}

{% tabs %}
{% highlight cshtml tabtitle="CSHTML" %}
{% include code-snippet/gantt/how-to/how-to-no-records-display-cs1/tagHelper %}
{% endhighlight %}
{% highlight c# tabtitle="NoRecordsDisplay.cs" %}
{% include code-snippet/gantt/how-to/how-to-no-records-display-cs1/no-records-display.cs %}
{% endhighlight %}
{% endtabs %}

{% elsif page.publishingplatform == "aspnet-mvc" %}

{% tabs %}
{% highlight razor tabtitle="CSHTML" %}
{% include code-snippet/gantt/how-to/how-to-no-records-display-cs1/razor %}
{% endhighlight %}
{% highlight c# tabtitle="NoRecordsDisplay.cs" %}
{% include code-snippet/gantt/how-to/how-to-no-records-display-cs1/no-records-display.cs %}
{% endhighlight %}
{% endtabs %}
{% endif %}

1 change: 1 addition & 0 deletions ej2-asp-core-toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,7 @@
<li><a href="/ej2-asp-core/gantt/how-to/drag-and-drop">Drag and drop from another component</a></li>
<li><a href="/ej2-asp-core/gantt/how-to/new-row-position">Add new row position while adding</a></li>
<li><a href="/ej2-asp-core/gantt/how-to/restrict-collapse-chart-rows">Restrict collapsing of records when clicking on Gantt chart rows</a></li>
<li><a href="/ej2-asp-core/gantt/how-to/no-records-display">Customize the empty datasource message</a></li>
</ul>
</li>
<li>
Expand Down
1 change: 1 addition & 0 deletions ej2-asp-mvc-toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -1258,6 +1258,7 @@
<li><a href="/ej2-asp-mvc/gantt/how-to/drag-and-drop">Drag and drop from another component</a></li>
<li><a href="/ej2-asp-mvc/gantt/how-to/new-row-position">Add new row position while adding</a></li>
<li><a href="/ej2-asp-mvc/gantt/how-to/restrict-collapse-chart-rows">Restrict collapsing of records when clicking on Gantt chart rows</a></li>
<li><a href="/ej2-asp-mvc/gantt/how-to/no-records-display">Customize the empty datasource message</a></li>
</ul>
</li>
<li>
Expand Down