Skip to content

Commit bb0a661

Browse files
Merge pull request #3083 from Syncfusion-Content/hotfix/hotfix-v26.1.35
DOCINFRA-2341_merged_using_automation
2 parents 0d54699 + cb84c09 commit bb0a661

File tree

181 files changed

+5495
-1145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+5495
-1145
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
layout: post
3+
title: Disabled Items in ##Platform_Name## AutoComplete Control | Syncfusion
4+
description: Learn here all about Disabled Items in Syncfusion ##Platform_Name## AutoComplete control of Syncfusion Essential JS 2 and more.
5+
platform: ej2-asp-core-mvc
6+
control: Disabled Items
7+
publishingplatform: ##Platform_Name##
8+
documentation: ug
9+
---
10+
11+
12+
# Disabled Items in ##Platform_Name## AutoComplete Control
13+
14+
The AutoComplete provides options for individual items to be either in an enabled or disabled state for specific scenarios. The category of each list item can be mapped through the [disabled](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.DropDowns.AutoCompleteFieldSettings.html#Syncfusion_EJ2_DropDowns_AutoCompleteFieldSettings_Disabled) field in the data table. Once an item is disabled, it cannot be selected as a value for the component. To configure the disabled item columns, use the `fields.disabled` property.
15+
16+
In the following sample, State are grouped according on its category using `disabled` field.
17+
18+
{% if page.publishingplatform == "aspnet-core" %}
19+
20+
{% tabs %}
21+
{% highlight cshtml tabtitle="CSHTML" %}
22+
{% include code-snippet/autocomplete/disabled-items/tagHelper %}
23+
{% endhighlight %}
24+
{% highlight c# tabtitle="CSHTML.cs" %}
25+
public class DisableStatusData
26+
{
27+
public string Status { get; set; }
28+
public bool State { get; set; }
29+
}
30+
{% endhighlight %}
31+
{% endtabs %}
32+
33+
{% elsif page.publishingplatform == "aspnet-mvc" %}
34+
35+
{% tabs %}
36+
{% highlight razor tabtitle="CSHTML" %}
37+
{% include code-snippet/autocomplete/disabled-items/razor %}
38+
{% endhighlight %}
39+
{% highlight c# tabtitle="DisabledItem.cs" %}
40+
{% include code-snippet/autocomplete/disabled-items/disabled-items.cs %}
41+
{% endhighlight %}
42+
{% endtabs %}
43+
{% endif %}
44+
45+
## Disable Item Method
46+
47+
The disableItem method can be used to handle dynamic changing in disable state of a specific item. Only one item can be disabled in this method. To disable multiple items, this method can be iterated with the items list or array. The disabled field state will to be updated in the [dataSource](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.DropDowns.AutoComplete.html#Syncfusion_EJ2_DropDowns_AutoComplete_DataSource), when the item is disabled using this method. If the selected item is disabled dynamically, then the selection will be cleared.
48+
49+
| Parameter | Type | Description |
50+
|------|------|------|
51+
| itemHTMLLIElement | <code>HTMLLIElement</code> | It accepts the HTML Li element of the item to be removed. |
52+
| itemValue | <code>string</code> \| <code>number</code> \| <code>boolean</code> \| <code>object</code> | It accepts the string, number, boolean and object type value of the item to be removed. |
53+
| itemIndex | <code>number</code> | It accepts the index of the item to be removed. |
54+
55+
## Enabled
56+
57+
If you want to disabled the overall component to set the [enabled](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.DropDowns.AutoComplete.html#Syncfusion_EJ2_DropDowns_AutoComplete_Enabled) property to false.
58+
59+
{% [Disabled AutoComplete Component](./images/autocomplete-disable.png)" %}
Loading
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
6+
namespace WebApplication1.Models
7+
{
8+
public class DisableStatusData
9+
{
10+
public string Status { get; set; }
11+
public bool State { get; set; }
12+
public List<DisableStatusData> StatusDataList()
13+
{
14+
List<DisableStatusData> status = new List<DisableStatusData>();
15+
status.Add(new DisableStatusData() { Status = "Open", State= false });
16+
status.Add(new DisableStatusData() { Status = "Waiting for Customer", State= false });
17+
status.Add(new DisableStatusData() { Status = "On Hold", State= true });
18+
status.Add(new DisableStatusData() { Status = "Follow-up", State= false });
19+
status.Add(new DisableStatusData() { Status = "Closed", State= true });
20+
status.Add(new DisableStatusData() { Status = "Solved", State= false });
21+
status.Add(new DisableStatusData() { Status = "Feature Request", State= false });
22+
23+
return status;
24+
}
25+
}
26+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc;
6+
using WebApplication1.Models;
7+
8+
namespace WebApplication1.Controllers
9+
{
10+
public class AutoCompleteController : Controller
11+
{
12+
public ActionResult Index()
13+
{
14+
ViewBag.data = new DisableStatusData().StatusDataList();
15+
return View();
16+
}
17+
}
18+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@Html.EJS().AutoComplete("Status").Placeholder("Select Status").PopupHeight("200px").DataSource((IEnumerable<object>)ViewBag.data).Fields(new Syncfusion.EJ2.DropDowns.AutoCompleteFieldSettings { Value = "Status", Disabled = "State" }).Render()
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@{
2+
List<DisableStatusData> status = new List<DisableStatusData>();
3+
status.Add(new DisableStatusData() { Status = "Open", State= false });
4+
status.Add(new DisableStatusData() { Status = "Waiting for Customer", State= false });
5+
status.Add(new DisableStatusData() { Status = "On Hold", State= true });
6+
status.Add(new DisableStatusData() { Status = "Follow-up", State= false });
7+
status.Add(new DisableStatusData() { Status = "Closed", State= true });
8+
status.Add(new DisableStatusData() { Status = "Solved", State= false });
9+
status.Add(new DisableStatusData() { Status = "Feature Request", State= false });
10+
}
11+
<div id='groupList' class='col-lg-6' style='padding-top:15px'>
12+
<div class='content'>
13+
<ejs-autocomplete id="status" placeholder="Select Status" popupHeight="200px" dataSource="@status">
14+
<e-autocomplete-fields value="Status" disabled="State" ></e-autocomplete-fields>
15+
</ejs-autocomplete>
16+
</div>
17+
</div>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
6+
namespace WebApplication1.Models
7+
{
8+
public class DisableStatusData
9+
{
10+
public string Status { get; set; }
11+
public bool State { get; set; }
12+
public List<DisableStatusData> StatusDataList()
13+
{
14+
List<DisableStatusData> status = new List<DisableStatusData>();
15+
status.Add(new DisableStatusData() { Status = "Open", State= false });
16+
status.Add(new DisableStatusData() { Status = "Waiting for Customer", State= false });
17+
status.Add(new DisableStatusData() { Status = "On Hold", State= true });
18+
status.Add(new DisableStatusData() { Status = "Follow-up", State= false });
19+
status.Add(new DisableStatusData() { Status = "Closed", State= true });
20+
status.Add(new DisableStatusData() { Status = "Solved", State= false });
21+
status.Add(new DisableStatusData() { Status = "Feature Request", State= false });
22+
23+
return status;
24+
}
25+
}
26+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc;
6+
using WebApplication1.Models;
7+
8+
namespace WebApplication1.Controllers
9+
{
10+
public class ComboBoxController : Controller
11+
{
12+
public ActionResult Index()
13+
{
14+
ViewBag.data = new DisableStatusData().StatusDataList();
15+
return View();
16+
}
17+
}
18+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@Html.EJS().ComboBox("Status").Placeholder("Select Status").PopupHeight("200px").DataSource((IEnumerable<object>)ViewBag.data).Fields(new Syncfusion.EJ2.DropDowns.ComboBoxFieldSettings { Value = "Status", Disabled = "State" }).Render()
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@{
2+
List<DisableStatusData> status = new List<DisableStatusData>();
3+
status.Add(new DisableStatusData() { Status = "Open", State= false });
4+
status.Add(new DisableStatusData() { Status = "Waiting for Customer", State= false });
5+
status.Add(new DisableStatusData() { Status = "On Hold", State= true });
6+
status.Add(new DisableStatusData() { Status = "Follow-up", State= false });
7+
status.Add(new DisableStatusData() { Status = "Closed", State= true });
8+
status.Add(new DisableStatusData() { Status = "Solved", State= false });
9+
status.Add(new DisableStatusData() { Status = "Feature Request", State= false });
10+
}
11+
<div id='groupList' class='col-lg-6' style='padding-top:15px'>
12+
<div class='content'>
13+
<ejs-combobox id="status" placeholder="Select Status" popupHeight="200px" dataSource="@status">
14+
<e-combobox-fields value="Status" disabled="State" ></e-combobox-fields>
15+
</ejs-combobox>
16+
</div>
17+
</div>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
6+
namespace WebApplication1.Models
7+
{
8+
public class DisableStatusData
9+
{
10+
public string Status { get; set; }
11+
public bool State { get; set; }
12+
public List<DisableStatusData> StatusDataList()
13+
{
14+
List<DisableStatusData> status = new List<DisableStatusData>();
15+
status.Add(new DisableStatusData() { Status = "Open", State= false });
16+
status.Add(new DisableStatusData() { Status = "Waiting for Customer", State= false });
17+
status.Add(new DisableStatusData() { Status = "On Hold", State= true });
18+
status.Add(new DisableStatusData() { Status = "Follow-up", State= false });
19+
status.Add(new DisableStatusData() { Status = "Closed", State= true });
20+
status.Add(new DisableStatusData() { Status = "Solved", State= false });
21+
status.Add(new DisableStatusData() { Status = "Feature Request", State= false });
22+
23+
return status;
24+
}
25+
}
26+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc;
6+
using WebApplication1.Models;
7+
8+
namespace WebApplication1.Controllers
9+
{
10+
public class DropDownListController : Controller
11+
{
12+
public ActionResult Index()
13+
{
14+
ViewBag.data = new DisableStatusData().StatusDataList();
15+
return View();
16+
}
17+
}
18+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@Html.EJS().DropDownList("Status").Placeholder("Select Status").PopupHeight("200px").DataSource((IEnumerable<object>)ViewBag.data).Fields(new Syncfusion.EJ2.DropDowns.DropDownListFieldSettings { Value = "Status", Disabled = "State" }).Render()
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@{
2+
List<DisableStatusData> status = new List<DisableStatusData>();
3+
status.Add(new DisableStatusData() { Status = "Open", State= false });
4+
status.Add(new DisableStatusData() { Status = "Waiting for Customer", State= false });
5+
status.Add(new DisableStatusData() { Status = "On Hold", State= true });
6+
status.Add(new DisableStatusData() { Status = "Follow-up", State= false });
7+
status.Add(new DisableStatusData() { Status = "Closed", State= true });
8+
status.Add(new DisableStatusData() { Status = "Solved", State= false });
9+
status.Add(new DisableStatusData() { Status = "Feature Request", State= false });
10+
}
11+
<div id='groupList' class='col-lg-6' style='padding-top:15px'>
12+
<div class='content'>
13+
<ejs-dropdownlist id="status" placeholder="Select Status" popupHeight="200px" dataSource="@status">
14+
<e-dropdownlist-fields value="Status" disabled="State" ></e-dropdownlist-fields>
15+
</ejs-dropdownlist>
16+
</div>
17+
</div>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@using Syncfusion.EJ2.MultiColumnComboBox;
2+
3+
<div id="container" style="width: 500px">
4+
@Html.EJS().MultiColumnComboBox("text").DataSource((IEnumerable<object>)Model).Fields(new MultiColumnComboBoxFieldSettings
5+
{ Text = "Name", Value = "EmpID" }).Columns(col =>
6+
{
7+
col.Field("EmpID").Header("Employee ID").Width("90").Add();
8+
col.Field("Name").Header("Name").TextAlign(TextAlign.Right).Width("90").Add();
9+
col.Field("Designation").Header("Designation").Width("90").Add();
10+
col.Field("Country").Header("Country").Width("70").Add();
11+
}).Text("Michael").Render()
12+
</div>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@using Syncfusion.EJ2.MultiColumnComboBox;
2+
3+
<div class="container" style="width: 500px">
4+
<ejs-multicolumncombobox id="text" dataSource="ViewBag.EmpData" text="Michael">
5+
<e-multicolumncombobox-fields text="Name" value="EmpID"></e-multicolumncombobox-fields>
6+
<e-multicolumncombobox-columns>
7+
<e-multicolumncombobox-column field="EmpID" header="Employee ID" width="90"></e-multicolumncombobox-column>
8+
<e-multicolumncombobox-column field="Name" header="Name" textAlign="Right" width="90"></e-multicolumncombobox-column>
9+
<e-multicolumncombobox-column field="Designation" header="Designation" width="90"></e-multicolumncombobox-column>
10+
<e-multicolumncombobox-column field="Country" header="Country" width="70"></e-multicolumncombobox-column>
11+
</e-multicolumncombobox-columns>
12+
</ejs-multicolumncombobox>
13+
</div>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
public ActionResult Demo()
2+
{
3+
var employees = new List<Employee>
4+
{
5+
new Employee { EmpID = 1001, Name = "Andrew Fuller", Designation = "Team Lead", Country = "England" },
6+
new Employee { EmpID = 1002, Name = "Robert", Designation = "Developer", Country = "USA" },
7+
new Employee { EmpID = 1003, Name = "Michael", Designation = "HR", Country = "Russia" },
8+
new Employee { EmpID = 1004, Name = "Steven Buchanan", Designation = "Product Manager", Country = "Ukraine" },
9+
new Employee { EmpID = 1005, Name = "Margaret Peacock", Designation = "Developer", Country = "Egypt" },
10+
new Employee { EmpID = 1006, Name = "Janet Leverling", Designation = "Team Lead", Country = "Africa" },
11+
new Employee { EmpID = 1007, Name = "Alice", Designation = "Product Manager", Country = "Australia" },
12+
new Employee { EmpID = 1008, Name = "Bob", Designation = "Developer", Country = "India" },
13+
new Employee { EmpID = 1009, Name = "John", Designation = "Product Manager", Country = "Ireland" },
14+
new Employee { EmpID = 1010, Name = "Mario Pontes", Designation = "Team Lead", Country = "South Africa" },
15+
new Employee { EmpID = 1011, Name = "Yang Wang", Designation = "Developer", Country = "Russia" },
16+
new Employee { EmpID = 1012, Name = "David", Designation = "Product Manager", Country = "Egypt" },
17+
new Employee { EmpID = 1013, Name = "Antonio Bianchi", Designation = "Team Lead", Country = "USA" },
18+
new Employee { EmpID = 1014, Name = "Laura", Designation = "Developer", Country = "England" },
19+
new Employee { EmpID = 1015, Name = "Carlos Hernandez", Designation = "Developer", Country = "Canada" },
20+
new Employee { EmpID = 1016, Name = "Lily", Designation = "Product Manager", Country = "France" },
21+
new Employee { EmpID = 1017, Name = "Tom Williams", Designation = "Developer", Country = "Ukraine" },
22+
new Employee { EmpID = 1018, Name = "Grace", Designation = "Developer", Country = "Australia" },
23+
new Employee { EmpID = 1019, Name = "Olivia", Designation = "Team Lead", Country = "Ireland" },
24+
new Employee { EmpID = 1020, Name = "James", Designation = "Developer", Country = "China" }
25+
};
26+
27+
ViewBag.EmpData = employees;
28+
return View(ViewBag.EmpData);
29+
}
30+
31+
public class Employee
32+
{
33+
public int EmpID { get; set; }
34+
public string Name { get; set; }
35+
public string Designation { get; set; }
36+
public string Country { get; set; }
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
public ActionResult Demo()
2+
{
3+
var employees = new List<Employee>
4+
{
5+
new Employee { EmpID = 1001, Name = "Andrew Fuller", Designation = "Team Lead", Country = "England" },
6+
new Employee { EmpID = 1002, Name = "Robert", Designation = "Developer", Country = "USA" },
7+
new Employee { EmpID = 1003, Name = "Michael", Designation = "HR", Country = "Russia" },
8+
new Employee { EmpID = 1004, Name = "Steven Buchanan", Designation = "Product Manager", Country = "Ukraine" },
9+
new Employee { EmpID = 1005, Name = "Margaret Peacock", Designation = "Developer", Country = "Egypt" },
10+
new Employee { EmpID = 1006, Name = "Janet Leverling", Designation = "Team Lead", Country = "Africa" },
11+
new Employee { EmpID = 1007, Name = "Alice", Designation = "Product Manager", Country = "Australia" },
12+
new Employee { EmpID = 1008, Name = "Bob", Designation = "Developer", Country = "India" },
13+
new Employee { EmpID = 1009, Name = "John", Designation = "Product Manager", Country = "Ireland" },
14+
new Employee { EmpID = 1010, Name = "Mario Pontes", Designation = "Team Lead", Country = "South Africa" },
15+
new Employee { EmpID = 1011, Name = "Yang Wang", Designation = "Developer", Country = "Russia" },
16+
new Employee { EmpID = 1012, Name = "David", Designation = "Product Manager", Country = "Egypt" },
17+
new Employee { EmpID = 1013, Name = "Antonio Bianchi", Designation = "Team Lead", Country = "USA" },
18+
new Employee { EmpID = 1014, Name = "Laura", Designation = "Developer", Country = "England" },
19+
new Employee { EmpID = 1015, Name = "Carlos Hernandez", Designation = "Developer", Country = "Canada" },
20+
new Employee { EmpID = 1016, Name = "Lily", Designation = "Product Manager", Country = "France" },
21+
new Employee { EmpID = 1017, Name = "Tom Williams", Designation = "Developer", Country = "Ukraine" },
22+
new Employee { EmpID = 1018, Name = "Grace", Designation = "Developer", Country = "Australia" },
23+
new Employee { EmpID = 1019, Name = "Olivia", Designation = "Team Lead", Country = "Ireland" },
24+
new Employee { EmpID = 1020, Name = "James", Designation = "Developer", Country = "China" }
25+
};
26+
27+
ViewBag.EmpData = employees;
28+
return View(ViewBag.EmpData);
29+
}
30+
31+
public class Employee
32+
{
33+
public int EmpID { get; set; }
34+
public string Name { get; set; }
35+
public string Designation { get; set; }
36+
public string Country { get; set; }
37+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@using Syncfusion.EJ2.MultiColumnComboBox;
2+
3+
<div id="container" style="width: 500px">
4+
@Html.EJS().MultiColumnComboBox("actionBegin").DataSource((IEnumerable<object>)Model).ActionBegin("function(args) { actionBegin(args) }").Fields(new MultiColumnComboBoxFieldSettings
5+
{ Text = "Name", Value = "EmpID" }).Columns(col =>
6+
{
7+
col.Field("EmpID").Header("Employee ID").Width("90").Add();
8+
col.Field("Name").Header("Name").Width("90").Add();
9+
col.Field("Designation").Header("Designation").Width("90").Add();
10+
col.Field("Country").Header("Country").Width("70").Add();
11+
}).Render()
12+
</div>
13+
14+
<script>
15+
function actionBegin(args) {
16+
// your required action here..
17+
}
18+
</script>

0 commit comments

Comments
 (0)