Skip to content

Commit

Permalink
Adding changes from build igniteui-xplat-examples-output+PRs_2024.6.14.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tfsbuild committed Jun 14, 2024
1 parent 3cdd3e3 commit 219a268
Show file tree
Hide file tree
Showing 18 changed files with 756 additions and 59 deletions.
63 changes: 35 additions & 28 deletions samples/grids/tree-grid/cell-editing-sample/App.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@
<div class="container vertical fill">
<IgbTreeGrid
AutoGenerate="false"
Id="treeGrid"
Name="treeGrid"
@ref="treeGrid"
Data="OrdersTreeData"
Name="treeGrid1"
@ref="treeGrid1"
Id="treeGrid1"
Data="RoleplayTreeGridData"
PrimaryKey="ID"
ForeignKey="ParentID">
<IgbColumn
Field="Name"
Header="Character Name"
DataType="GridColumnDataType.String">
</IgbColumn>

<IgbColumn
Field="Category"
Field="Race"
Header="Race"
DataType="GridColumnDataType.String"
Editable="true"
InlineEditorTemplateScript="WebTreeGridCellEditCellTemplate"
Expand All @@ -27,29 +29,30 @@
</IgbColumn>

<IgbColumn
Field="Units"
DataType="GridColumnDataType.Number"
Editable="true">
</IgbColumn>

<IgbColumn
Field="UnitPrice"
Header="Unit Price"
DataType="GridColumnDataType.Number"
Editable="true">
Field="Class"
Header="Class"
InlineEditorTemplateScript="WebTreeGridCellEditCellTemplate"
DataType="GridColumnDataType.String"
Editable="true"
Name="column2"
@ref="column2">
</IgbColumn>

<IgbColumn
Field="OrderDate"
Header="Order Date"
DataType="GridColumnDataType.Date"
Field="Age"
Header="Age"
DataType="GridColumnDataType.String"
Editable="true">
</IgbColumn>

<IgbColumn
Field="Delivered"
DataType="GridColumnDataType.Boolean"
Editable="true">
Field="Alignment"
Header="Alignment"
InlineEditorTemplateScript="WebTreeGridCellEditCellTemplate"
DataType="GridColumnDataType.String"
Editable="true"
Name="column3"
@ref="column3">
</IgbColumn>

</IgbTreeGrid>
Expand All @@ -61,24 +64,28 @@

protected override async Task OnAfterRenderAsync(bool firstRender)
{
var treeGrid = this.treeGrid;
var treeGrid1 = this.treeGrid1;
var column1 = this.column1;
var column2 = this.column2;
var column3 = this.column3;

}

private IgbTreeGrid treeGrid;
private IgbTreeGrid treeGrid1;
private IgbColumn column1;
private IgbColumn column2;
private IgbColumn column3;

private OrdersTreeData _ordersTreeData = null;
public OrdersTreeData OrdersTreeData
private RoleplayTreeGridData _roleplayTreeGridData = null;
public RoleplayTreeGridData RoleplayTreeGridData
{
get
{
if (_ordersTreeData == null)
if (_roleplayTreeGridData == null)
{
_ordersTreeData = new OrdersTreeData();
_roleplayTreeGridData = new RoleplayTreeGridData();
}
return _ordersTreeData;
return _roleplayTreeGridData;
}
}

Expand Down
3 changes: 1 addition & 2 deletions samples/grids/tree-grid/cell-editing-sample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ public static async Task Main(string[] args)
// registering Ignite UI modules
builder.Services.AddIgniteUIBlazor(
typeof(IgbInputModule),
typeof(IgbTreeGridModule),
typeof(IgbSelectModule)
typeof(IgbTreeGridModule)
);
await builder.Build().RunAsync();
}
Expand Down
250 changes: 250 additions & 0 deletions samples/grids/tree-grid/cell-editing-sample/RoleplayTreeGridData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,250 @@
using System;
using System.Collections.Generic;
public class RoleplayTreeGridDataItem
{
public double ID { get; set; }
public double ParentID { get; set; }
public string Name { get; set; }
public string Age { get; set; }
public string Alignment { get; set; }
public string Race { get; set; }
public string Class { get; set; }
}

public class RoleplayTreeGridData
: List<RoleplayTreeGridDataItem>
{
public RoleplayTreeGridData()
{
this.Add(new RoleplayTreeGridDataItem()
{
ID = 1,
ParentID = 8,
Name = @"Stredo",
Age = @"244",
Alignment = @"💜 Lawful evil",
Race = @"👩 Human",
Class = @"🎻 Bard"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 2,
ParentID = 7,
Name = @"Haluun",
Age = @"40",
Alignment = @"🤍 Unaligned",
Race = @"🧒🏻 Hafling",
Class = @"🙏🏻 Monk"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 3,
ParentID = 9,
Name = @"Ivellios",
Age = @"244",
Alignment = @"🧡 Chaotic good",
Race = @"👩 Human",
Class = @"⚔️ Paladin"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 4,
ParentID = -1,
Name = @"Tes",
Age = @"35",
Alignment = @"💜 Lawful evil",
Race = @"🎭 Changeling",
Class = @"🧙‍♂️ Wizard"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 5,
ParentID = 3,
Name = @"Kalla",
Age = @"47",
Alignment = @"🤎 Neutral evil",
Race = @"🤖 Warforged",
Class = @"🦹‍♂️ Sorcerer"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 6,
ParentID = 2,
Name = @"Halimath Dundragon",
Age = @"149",
Alignment = @"🤍 Unaligned",
Race = @"🐲 Dragonborn",
Class = @"⚔️ Paladin"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 7,
ParentID = 5,
Name = @"Iriphawa",
Age = @"39",
Alignment = @"💛 Lawful neutral",
Race = @"🧝🏻‍♂️ Half-Elf",
Class = @"🏹 Ranger"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 8,
ParentID = 6,
Name = @"Quaf",
Age = @"25",
Alignment = @"💚 Neutral",
Race = @"👩 Human",
Class = @"🥊 Fighter"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 9,
ParentID = 10,
Name = @"Rat Scratch",
Age = @"15",
Alignment = @"🤎 Neutral evil",
Race = @"🐡 Locathah",
Class = @"🍁 Druid"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 10,
ParentID = 4,
Name = @"Slicer",
Age = @"57",
Alignment = @"💜 Lawful evil",
Race = @"🐡 Locathah",
Class = @"💪 Barbarian"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 11,
ParentID = 7,
Name = @"Nereones Ahlorsath",
Age = @"95",
Alignment = @"💛 Lawful neutral",
Race = @"👩 Human",
Class = @"🥊 Fighter"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 12,
ParentID = 9,
Name = @"Nalvarti Stonecutter",
Age = @"118",
Alignment = @"❤️ Neutral good",
Race = @"🧝‍♀️ Elf",
Class = @"❤️‍ Cleric"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 13,
ParentID = 1,
Name = @"Errk",
Age = @"22",
Alignment = @"🤎 Neutral evil",
Race = @"🧝🏻‍♂️ Half-Elf",
Class = @"🎻 Bard"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 14,
ParentID = 5,
Name = @"Seven Thundercloud",
Age = @"43",
Alignment = @"💖 Lawful good",
Race = @"🐡 Locathah",
Class = @"⚔️ Paladin"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 15,
ParentID = 10,
Name = @"Navarra Chergoba",
Age = @"16",
Alignment = @"💜 Lawful evil",
Race = @"🐯 Tabaxi",
Class = @"❤️‍ Cleric"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 16,
ParentID = 4,
Name = @"Sail Snap",
Age = @"56",
Alignment = @"💖 Lawful good",
Race = @"🌳 Arboren",
Class = @"💪 Barbarian"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 17,
ParentID = 8,
Name = @"Urreek",
Age = @"17",
Alignment = @"💜 Lawful evil",
Race = @"🧝🏻‍♂️ Half-Elf",
Class = @"🐉 Warlock"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 18,
ParentID = 6,
Name = @"Morkral Firetamer",
Age = @"24",
Alignment = @"🤎 Neutral evil",
Race = @"🐲 Dragonborn",
Class = @"🙏🏻 Monk"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 19,
ParentID = 2,
Name = @"Vithka",
Age = @"53",
Alignment = @"💜 Lawful evil",
Race = @"🐡 Locathah",
Class = @"⚔️ Paladin"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 20,
ParentID = 7,
Name = @"Sandrue Avhoste",
Age = @"19",
Alignment = @"💙 Chaotic Neutral",
Race = @"🐲 Dragonborn",
Class = @"🗡️ Rogue"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 21,
ParentID = 8,
Name = @"Hapah Moq",
Age = @"34",
Alignment = @"💜 Lawful evil",
Race = @"🎅🏽 Dwarf",
Class = @"🎻 Bard"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 22,
ParentID = 5,
Name = @"Kothar",
Age = @"55",
Alignment = @"🤍 Unaligned",
Race = @"🧝🏻‍♂️ Half-Elf",
Class = @"🐉 Warlock"
});
this.Add(new RoleplayTreeGridDataItem()
{
ID = 23,
ParentID = 1,
Name = @"Senen",
Age = @"40",
Alignment = @"💜 Lawful evil",
Race = @"🧒🏻 Hafling",
Class = @"🥊 Fighter"
});
}
}
13 changes: 6 additions & 7 deletions samples/grids/tree-grid/cell-editing-sample/wwwroot/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ igRegisterScript("WebTreeGridCellEditCellTemplate", (ctx) => {
var html = window.igTemplating.html;
let cellValues = [];
let uniqueValues = [];
for (const item of ctx.cell.grid.data) {
for (const i of ctx.cell.grid.data) {
const field = ctx.cell.column.field;
const value = item[field];
if (uniqueValues.indexOf(value) === -1 && value !== "") {
if (ctx.cell.value == value) {
cellValues.push(html`<igc-select-item selected value=${value}>${(value)}</igc-select-item>`);
} else cellValues.push(html`<igc-select-item value=${value}>${(value)}</igc-select-item>`);
uniqueValues.push(value);
if (uniqueValues.indexOf(i[field]) === -1) {
if (ctx.cell.value == i[field]) {
cellValues.push(html`<igc-select-item selected value=${i[field]}>${(i[field])}</igc-select-item>`);
} else cellValues.push(html`<igc-select-item value=${i[field]}>${(i[field])}</igc-select-item>`);
uniqueValues.push(i[field]);
}
}
return html`
Expand Down
Loading

0 comments on commit 219a268

Please sign in to comment.