Blazor Grid Row Adding
Blazor Grid의 Ignite UI for Blazor Row Adding 기능을 사용하면 사용자는 별도의 양식이나 페이지로 이동하지 않고도 새 데이터 레코드를 입력하고 제출할 수 있습니다. IgbGrid
를 사용하면 사용자는 인라인 행 추가와 CRUD 작업을 위한 강력한 API를 통해 데이터를 조작할 수 있습니다. 그리드 템플릿에서 편집 작업이 활성화된 IgbActionStrip
구성 요소를 추가합니다. 그런 다음 행을 마우스오버하고 제공된 버튼을 사용합니다. 마지막으로 ALT + + 를 눌러 행 추가 UI를 생성합니다.
すぐに使用できる機能のフルセット は、ページング、ソート、フィルタリング、編集、グループ化から行と列の仮想化まで、あらゆる機能をカバーします。.NET 開発者には制限はありません。
Blazor Grid Row Adding Example
EXAMPLE
MODULES
DATA
RAZOR
CSS
using System;
using System.Net.Http;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Text;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using IgniteUI.Blazor.Controls;
namespace Infragistics.Samples
{
public class Program
{
public static async Task Main (string [] args )
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app" );
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddIgniteUIBlazor(
typeof (IgbInputModule),
typeof (IgbGridModule)
);
await builder.Build().RunAsync();
}
}
}
cs コピー using System;
using System.Collections.Generic;
public class NwindDataItem
{
public double ProductID { get ; set ; }
public string ProductName { get ; set ; }
public double SupplierID { get ; set ; }
public double CategoryID { get ; set ; }
public string QuantityPerUnit { get ; set ; }
public double UnitPrice { get ; set ; }
public double UnitsInStock { get ; set ; }
public double UnitsOnOrder { get ; set ; }
public double ReorderLevel { get ; set ; }
public bool Discontinued { get ; set ; }
public string OrderDate { get ; set ; }
public double Rating { get ; set ; }
public List<NwindDataItem_LocationsItem> Locations { get ; set ; }
}
public class NwindDataItem_LocationsItem
{
public string Shop { get ; set ; }
public string LastInventory { get ; set ; }
}
public class NwindData
: List <NwindDataItem >
{
public NwindData ( )
{
this .Add(new NwindDataItem()
{
ProductID = 1 ,
ProductName = @"Chai" ,
SupplierID = 1 ,
CategoryID = 1 ,
QuantityPerUnit = @"10 boxes x 20 bags" ,
UnitPrice = 18 ,
UnitsInStock = 39 ,
UnitsOnOrder = 30 ,
ReorderLevel = 10 ,
Discontinued = false ,
OrderDate = @"2012-02-12" ,
Rating = 5 ,
Locations = new List<NwindDataItem_LocationsItem>()
{
new NwindDataItem_LocationsItem()
{
Shop = @"Fun-Tasty Co." ,
LastInventory = @"2018-06-12"
},
new NwindDataItem_LocationsItem()
{
Shop = @"Farmer Market" ,
LastInventory = @"2018-04-04"
}}
});
this .Add(new NwindDataItem()
{
ProductID = 2 ,
ProductName = @"Chang" ,
SupplierID = 1 ,
CategoryID = 1 ,
QuantityPerUnit = @"24 - 12 oz bottles" ,
UnitPrice = 19 ,
UnitsInStock = 17 ,
UnitsOnOrder = 40 ,
ReorderLevel = 25 ,
Discontinued = true ,
OrderDate = @"2003-03-17" ,
Rating = 5 ,
Locations = new List<NwindDataItem_LocationsItem>()
{
new NwindDataItem_LocationsItem()
{
Shop = @"Super Market" ,
LastInventory = @"2018-09-09"
}}
});
this .Add(new NwindDataItem()
{
ProductID = 3 ,
ProductName = @"Aniseed Syrup" ,
SupplierID = 1 ,
CategoryID = 2 ,
QuantityPerUnit = @"12 - 550 ml bottles" ,
UnitPrice = 10 ,
UnitsInStock = 13 ,
UnitsOnOrder = 70 ,
ReorderLevel = 25 ,
Discontinued = false ,
OrderDate = @"2006-03-17" ,
Rating = 3 ,
Locations = new List<NwindDataItem_LocationsItem>()
{
new NwindDataItem_LocationsItem()
{
Shop = @"Farmer Market" ,
LastInventory = @"2018-04-04"
},
new NwindDataItem_LocationsItem()
{
Shop = @"Street Market" ,
LastInventory = @"2018-12-12"
},
new NwindDataItem_LocationsItem()
{
Shop = @"24/7 Market" ,
LastInventory = @"2018-11-11"
}}
});
this .Add(new NwindDataItem()
{
ProductID = 4 ,
ProductName = @"Chef Antons Cajun Seasoning" ,
SupplierID = 2 ,
CategoryID = 2 ,
QuantityPerUnit = @"48 - 6 oz jars" ,
UnitPrice = 22 ,
UnitsInStock = 53 ,
UnitsOnOrder = 30 ,
ReorderLevel = 0 ,
Discontinued = false ,
OrderDate = @"2016-03-17" ,
Rating = 3 ,
Locations = new List<NwindDataItem_LocationsItem>()
{
new NwindDataItem_LocationsItem()
{
Shop = @"Fun-Tasty Co." ,
LastInventory = @"2018-06-12"
},
new NwindDataItem_LocationsItem()
{
Shop = @"Farmer Market" ,
LastInventory = @"2018-04-04"
},
new NwindDataItem_LocationsItem()
{
Shop = @"Street Market" ,
LastInventory = @"2018-12-12"
}}
});
this .Add(new NwindDataItem()
{
ProductID = 5 ,
ProductName = @"Chef Antons Gumbo Mix" ,
SupplierID = 2 ,
CategoryID = 2 ,
QuantityPerUnit = @"36 boxes" ,
UnitPrice = 21.35 ,
UnitsInStock = 0 ,
UnitsOnOrder = 30 ,
ReorderLevel = 0 ,
Discontinued = true ,
OrderDate = @"2011-11-11" ,
Rating = 5 ,
Locations = new List<NwindDataItem_LocationsItem>()
{
new NwindDataItem_LocationsItem()
{
Shop = @"Super Market" ,
LastInventory = @"2018-09-09"
}}
});
this .Add(new NwindDataItem()
{
ProductID = 6 ,
ProductName = @"Grandmas Boysenberry Spread" ,
SupplierID = 3 ,
CategoryID = 2 ,
QuantityPerUnit = @"12 - 8 oz jars" ,
UnitPrice = 25 ,
UnitsInStock = 0 ,
UnitsOnOrder = 30 ,
ReorderLevel = 25 ,
Discontinued = false ,
OrderDate = @"2017-12-17" ,
Rating = 4 ,
Locations = new List<NwindDataItem_LocationsItem>()
{
new NwindDataItem_LocationsItem()
{
Shop = @"Super Market" ,
LastInventory = @"2018-09-09"
}}
});
this .Add(new NwindDataItem()
{
ProductID = 7 ,
ProductName = @"Uncle Bobs Organic Dried Pears" ,
SupplierID = 3 ,
CategoryID = 7 ,
QuantityPerUnit = @"12 - 1 lb pkgs." ,
UnitPrice = 30 ,
UnitsInStock = 150 ,
UnitsOnOrder = 30 ,
ReorderLevel = 10 ,
Discontinued = false ,
OrderDate = @"2016-07-17" ,
Rating = 5 ,
Locations = new List<NwindDataItem_LocationsItem>()
{
new NwindDataItem_LocationsItem()
{
Shop = @"Fun-Tasty Co." ,
LastInventory = @"2018-06-12"
},
new NwindDataItem_LocationsItem()
{
Shop = @"Farmer Market" ,
LastInventory = @"2018-04-04"
},
new NwindDataItem_LocationsItem()
{
Shop = @"Street Market" ,
LastInventory = @"2018-12-12"
}}
});
this .Add(new NwindDataItem()
{
ProductID = 8 ,
ProductName = @"Northwoods Cranberry Sauce" ,
SupplierID = 3 ,
CategoryID = 2 ,
QuantityPerUnit = @"12 - 12 oz jars" ,
UnitPrice = 40 ,
UnitsInStock = 6 ,
UnitsOnOrder = 30 ,
ReorderLevel = 0 ,
Discontinued = false ,
OrderDate = @"2018-01-17" ,
Rating = 4 ,
Locations = new List<NwindDataItem_LocationsItem>()
{
new NwindDataItem_LocationsItem()
{
Shop = @"Fun-Tasty Co." ,
LastInventory = @"2018-06-12"
},
new NwindDataItem_LocationsItem()
{
Shop = @"Farmer Market" ,
LastInventory = @"2018-04-04"
}}
});
this .Add(new NwindDataItem()
{
ProductID = 9 ,
ProductName = @"Mishi Kobe Niku" ,
SupplierID = 4 ,
CategoryID = 6 ,
QuantityPerUnit = @"18 - 500 g pkgs." ,
UnitPrice = 97 ,
UnitsInStock = 29 ,
UnitsOnOrder = 30 ,
ReorderLevel = 0 ,
Discontinued = true ,
OrderDate = @"2010-02-17" ,
Rating = 4 ,
Locations = new List<NwindDataItem_LocationsItem>()
{
new NwindDataItem_LocationsItem()
{
Shop = @"Farmer Market" ,
LastInventory = @"2018-04-04"
}}
});
this .Add(new NwindDataItem()
{
ProductID = 10 ,
ProductName = @"Ikura" ,
SupplierID = 4 ,
CategoryID = 8 ,
QuantityPerUnit = @"12 - 200 ml jars" ,
UnitPrice = 31 ,
UnitsInStock = 31 ,
UnitsOnOrder = 30 ,
ReorderLevel = 0 ,
Discontinued = false ,
OrderDate = @"2008-05-17" ,
Rating = 3 ,
Locations = new List<NwindDataItem_LocationsItem>()
{
new NwindDataItem_LocationsItem()
{
Shop = @"Wall Market" ,
LastInventory = @"2018-12-06"
}}
});
this .Add(new NwindDataItem()
{
ProductID = 11 ,
ProductName = @"Queso Cabrales" ,
SupplierID = 5 ,
CategoryID = 4 ,
QuantityPerUnit = @"1 kg pkg." ,
UnitPrice = 21 ,
UnitsInStock = 22 ,
UnitsOnOrder = 30 ,
ReorderLevel = 30 ,
Discontinued = false ,
OrderDate = @"2009-01-17" ,
Rating = 5 ,
Locations = new List<NwindDataItem_LocationsItem>()
{
new NwindDataItem_LocationsItem()
{
Shop = @"Fun-Tasty Co." ,
LastInventory = @"2018-06-12"
},
new NwindDataItem_LocationsItem()
{
Shop = @"Farmer Market" ,
LastInventory = @"2018-04-04"
}}
});
this .Add(new NwindDataItem()
{
ProductID = 12 ,
ProductName = @"Queso Manchego La Pastora" ,
SupplierID = 5 ,
CategoryID = 4 ,
QuantityPerUnit = @"10 - 500 g pkgs." ,
UnitPrice = 38 ,
UnitsInStock = 86 ,
UnitsOnOrder = 30 ,
ReorderLevel = 0 ,
Discontinued = false ,
OrderDate = @"2015-11-17" ,
Rating = 3 ,
Locations = new List<NwindDataItem_LocationsItem>()
{
new NwindDataItem_LocationsItem()
{
Shop = @"Farmer Market" ,
LastInventory = @"2018-04-04"
}}
});
this .Add(new NwindDataItem()
{
ProductID = 13 ,
ProductName = @"Konbu" ,
SupplierID = 6 ,
CategoryID = 8 ,
QuantityPerUnit = @"2 kg box" ,
UnitPrice = 6 ,
UnitsInStock = 24 ,
UnitsOnOrder = 30 ,
ReorderLevel = 5 ,
Discontinued = false ,
OrderDate = @"2015-03-17" ,
Rating = 2 ,
Locations = new List<NwindDataItem_LocationsItem>()
{
new NwindDataItem_LocationsItem()
{
Shop = @"Super Market" ,
LastInventory = @"2018-09-09"
}}
});
this .Add(new NwindDataItem()
{
ProductID = 14 ,
ProductName = @"Tofu" ,
SupplierID = 6 ,
CategoryID = 7 ,
QuantityPerUnit = @"40 - 100 g pkgs." ,
UnitPrice = 23.25 ,
UnitsInStock = 35 ,
UnitsOnOrder = 30 ,
ReorderLevel = 0 ,
Discontinued = false ,
OrderDate = @"2017-06-17" ,
Rating = 4 ,
Locations = new List<NwindDataItem_LocationsItem>()
{
new NwindDataItem_LocationsItem()
{
Shop = @"Farmer Market" ,
LastInventory = @"2018-04-04"
},
new NwindDataItem_LocationsItem()
{
Shop = @"Street Market" ,
LastInventory = @"2018-12-12"
}}
});
this .Add(new NwindDataItem()
{
ProductID = 15 ,
ProductName = @"Genen Shouyu" ,
SupplierID = 6 ,
CategoryID = 2 ,
QuantityPerUnit = @"24 - 250 ml bottles" ,
UnitPrice = 15.5 ,
UnitsInStock = 39 ,
UnitsOnOrder = 30 ,
ReorderLevel = 5 ,
Discontinued = false ,
OrderDate = @"2014-03-17" ,
Rating = 4 ,
Locations = new List<NwindDataItem_LocationsItem>()
{
new NwindDataItem_LocationsItem()
{
Shop = @"Local Market" ,
LastInventory = @"2018-07-03"
},
new NwindDataItem_LocationsItem()
{
Shop = @"Wall Market" ,
LastInventory = @"2018-12-06"
}}
});
this .Add(new NwindDataItem()
{
ProductID = 16 ,
ProductName = @"Pavlova" ,
SupplierID = 7 ,
CategoryID = 3 ,
QuantityPerUnit = @"32 - 500 g boxes" ,
UnitPrice = 17.45 ,
UnitsInStock = 29 ,
UnitsOnOrder = 30 ,
ReorderLevel = 10 ,
Discontinued = false ,
OrderDate = @"2018-03-28" ,
Rating = 2 ,
Locations = new List<NwindDataItem_LocationsItem>()
{
new NwindDataItem_LocationsItem()
{
Shop = @"Farmer Market" ,
LastInventory = @"2018-04-04"
},
new NwindDataItem_LocationsItem()
{
Shop = @"Street Market" ,
LastInventory = @"2018-12-12"
},
new NwindDataItem_LocationsItem()
{
Shop = @"24/7 Market" ,
LastInventory = @"2018-11-11"
}}
});
this .Add(new NwindDataItem()
{
ProductID = 17 ,
ProductName = @"Alice Mutton" ,
SupplierID = 7 ,
CategoryID = 6 ,
QuantityPerUnit = @"20 - 1 kg tins" ,
UnitPrice = 39 ,
UnitsInStock = 0 ,
UnitsOnOrder = 30 ,
ReorderLevel = 0 ,
Discontinued = true ,
OrderDate = @"2015-08-17" ,
Rating = 2 ,
Locations = new List<NwindDataItem_LocationsItem>()
{
new NwindDataItem_LocationsItem()
{
Shop = @"Farmer Market" ,
LastInventory = @"2018-04-04"
}}
});
this .Add(new NwindDataItem()
{
ProductID = 18 ,
ProductName = @"Carnarvon Tigers" ,
SupplierID = 7 ,
CategoryID = 8 ,
QuantityPerUnit = @"16 kg pkg." ,
UnitPrice = 62.5 ,
UnitsInStock = 42 ,
UnitsOnOrder = 30 ,
ReorderLevel = 0 ,
Discontinued = false ,
OrderDate = @"2005-09-27" ,
Rating = 2 ,
Locations = new List<NwindDataItem_LocationsItem>()
{
new NwindDataItem_LocationsItem()
{
Shop = @"24/7 Market" ,
LastInventory = @"2018-11-11"
},
new NwindDataItem_LocationsItem()
{
Shop = @"Super Market" ,
LastInventory = @"2018-09-09"
}}
});
this .Add(new NwindDataItem()
{
ProductID = 19 ,
ProductName = @"Teatime Chocolate Biscuits" ,
SupplierID = 8 ,
CategoryID = 3 ,
QuantityPerUnit = @"" ,
UnitPrice = 9.2 ,
UnitsInStock = 25 ,
UnitsOnOrder = 30 ,
ReorderLevel = 5 ,
Discontinued = false ,
OrderDate = @"2001-03-17" ,
Rating = 2 ,
Locations = new List<NwindDataItem_LocationsItem>()
{
new NwindDataItem_LocationsItem()
{
Shop = @"Local Market" ,
LastInventory = @"2018-07-03"
}}
});
this .Add(new NwindDataItem()
{
ProductID = 20 ,
ProductName = @"Sir Rodneys Marmalade" ,
SupplierID = 8 ,
CategoryID = 3 ,
QuantityPerUnit = @"4 - 100 ml jars" ,
UnitPrice = 4.5 ,
UnitsInStock = 40 ,
UnitsOnOrder = 30 ,
ReorderLevel = 0 ,
Discontinued = false ,
OrderDate = @"2005-03-17" ,
Rating = 5 ,
Locations = new List<NwindDataItem_LocationsItem>()
{
new NwindDataItem_LocationsItem()
{
Shop = @"Super Market" ,
LastInventory = @"2018-09-09"
}}
});
}
}
cs コピー
@using IgniteUI.Blazor.Controls
<div class ="container vertical ig-typography" >
<div class ="container vertical fill" >
<IgbGrid
AutoGenerate ="false"
Name ="grid"
@ref ="grid"
Id ="grid"
Data ="NwindData"
PrimaryKey ="ProductID"
RowEditable ="true" >
<IgbActionStrip
>
<IgbGridEditingActions
AddRow ="true" >
</IgbGridEditingActions >
</IgbActionStrip >
<IgbColumn
Field ="ProductID"
Header ="Product ID"
DataType ="GridColumnDataType.Number"
Hidden ="true" >
</IgbColumn >
<IgbColumn
Field ="ReorderLevel"
Header ="Reorder Level"
DataType ="GridColumnDataType.Number" >
</IgbColumn >
<IgbColumn
Field ="ProductName"
Header ="Product Name"
DataType ="GridColumnDataType.String" >
</IgbColumn >
<IgbColumn
Field ="UnitsInStock"
Header ="Units In Stock"
DataType ="GridColumnDataType.Number" >
</IgbColumn >
<IgbColumn
Field ="UnitPrice"
Header ="Unit Price"
DataType ="GridColumnDataType.Number"
Sortable ="true" >
</IgbColumn >
<IgbColumn
Field ="OrderDate"
Header ="Order Date"
DataType ="GridColumnDataType.Date" >
</IgbColumn >
<IgbColumn
Field ="Discontinued"
Header ="Discontinued"
DataType ="GridColumnDataType.Boolean" >
</IgbColumn >
</IgbGrid >
</div >
</div >
@code {
protected override async Task OnAfterRenderAsync (bool firstRender )
{
var grid = this .grid;
}
private IgbGrid grid;
private NwindData _nwindData = null ;
public NwindData NwindData
{
get
{
if (_nwindData == null )
{
_nwindData = new NwindData();
}
return _nwindData;
}
}
}
razor コピー
Like this sample? Get access to our complete Ignite UI for Blazor toolkit and start building your own apps in minutes. Download it for free.
Row Adding Usage
그런 다음 바인딩된 데이터 소스가 있는 IgbGrid
, RowEditable
true로 설정되고 편집 작업이 활성화된 IgbActionStrip
구성 요소를 정의합니다. AddRow
입력은 행 추가 UI를 생성하는 버튼의 가시성을 제어합니다.
<IgbGrid AutoGenerate ="false" Id ="grid" Data ="NwindData" PrimaryKey ="ProductID" RowEditable ="true" >
<IgbColumn Field ="ProductID" Header ="Product ID" DataType ="GridColumnDataType.Number" > </IgbColumn >
<IgbColumn Field ="ReorderLevel" Header ="Reorder Level" DataType ="GridColumnDataType.Number" > </IgbColumn >
<IgbColumn Field ="ProductName" Header ="Product Name" DataType ="GridColumnDataType.String" > </IgbColumn >
<IgbColumn Field ="UnitsInStock" Header ="Units In Stock" DataType ="GridColumnDataType.Number" > </IgbColumn >
<IgbColumn Field ="OrderDate" Header ="Order Date" DataType ="GridColumnDataType.Date" > </IgbColumn >
<IgbColumn Field ="Discontinued" Header ="Discontinued" DataType ="GridColumnDataType.Boolean" > </IgbColumn >
<IgbActionStrip >
<IgbGridEditingActions AddRow ="true" > </IgbGridEditingActions >
</IgbActionStrip >
</IgbGrid >
razor
참고 : 행 추가 작업에는 기본 키 설정이 필수입니다.
참고 : 기본 키를 제외한 모든 열은 기본적으로 UI를 추가하는 행에서 편집 가능합니다. 특정 열에 대한 편집을 비활성화하려면 Editable
열의 입력을 false
로 설정해야 합니다.
참고 : 행 추가 버튼의 가시성을 제어하는 IgbGridEditingActions
입력은 버튼이 표시하는 레코드를 미세 조정하기 위해 IgbRowType
유형인 작업 스트립 컨텍스트를 사용할 수 있습니다.
내부 BaseTransactionService
자동으로 제공됩니다 Grid
. 행 상태가 제출되거나 취소될 때까지 보류 중인 셀 변경 사항을 보유합니다.
Start Row Adding Programmatically
Grid
사용하면 두 가지 다른 공개 메서드를 사용하여 행 추가 UI를 프로그래밍 방식으로 생성할 수 있습니다. 하나는 UI가 생성되어야 하는 행을 지정하기 위해 행 ID를 허용하고 다른 하나는 인덱스로 작동합니다. 이러한 메서드를 사용하면 현재 데이터 보기 내 어디에서나 UI를 생성할 수 있습니다. 페이지를 변경하거나 필터링된 행을 지정하는 것은 지원되지 않습니다.
BeginAddRowById
사용하려면 해당 RowID
(PK)를 통해 작업의 컨텍스트로 사용할 행을 지정해야 합니다. 그런 다음 메서드는 최종 사용자가 지정된 행에 대한 행 추가 작업 스트립 버튼을 클릭한 것처럼 작동하여 그 아래에 UI를 생성합니다. 첫 번째 매개변수에 null
전달하여 UI가 그리드의 첫 번째 행으로 생성되도록 할 수도 있습니다.
@code {
await this .grid.BeginAddRowByIdAsync('ALFKI' , false );
await this .grid.BeginAddRowByIdAsync(null , false );
}
razor
beginAddRowByIndex
메서드는 비슷하게 작동하지만 UI가 생성되어야 하는 인덱스를 지정해야 합니다. 허용되는 값의 범위는 0과 데이터 보기 크기 - 1 사이입니다.
@code {
await this .grid.BeginAddRowByIndexAsync(10 );
await this .grid.BeginAddRowByIndexAsync(0 );
}
razor
Positioning
행 추가 UI의 기본 위치는 최종 사용자가 행 추가 버튼을 클릭한 행 아래에 있습니다.
The Grid
scrolls to fully display the add row UI automatically.
행 추가 UI의 오버레이는 스크롤 중에 위치를 유지합니다.
Behavior
행 추가 UI는 최종 사용자에게 일관된 편집 환경을 제공하도록 설계되었으므로 행 편집 UI와 동작이 동일합니다. 자세한 내용은 그리드 행 편집 항목을 참조하세요.
행 추가 UI를 통해 새 행이 추가된 후 해당 행의 위치 및/또는 가시성은 Grid
의 정렬, 필터링 및 그룹화 상태에 따라 결정됩니다. 이러한 상태가 적용되지 않은 Grid
에서는 마지막 레코드로 나타납니다. 최종 사용자가 Grid
보이지 않는 경우 해당 위치로 스크롤하는 데 사용할 수 있는 버튼이 포함된 스낵바가 간략하게 표시됩니다.
Keyboard Navigation
ALT + + - 행 추가를 위한 편집 모드로 들어갑니다.
ESC는 변경 사항을 제출하지 않고 행 추가 모드를 종료합니다.
Tab 키를 누르면 행의 편집 가능한 한 셀에서 다음 셀로, 가장 오른쪽의 편집 가능한 셀에서 CANCEL 및 DONE 버튼으로 초점을 이동합니다. 완료 버튼을 통한 탐색은 현재 편집된 행 내에서 편집 가능한 가장 왼쪽 셀로 이동합니다.
Feature Integration
Grid
의 데이터 보기가 수정되면 행 추가 작업이 중지됩니다. 최종 사용자가 변경한 모든 내용이 제출됩니다. 데이터 보기를 변경하는 작업에는 정렬, 그룹화, 필터링, 페이징 등이 포함되지만 이에 국한되지는 않습니다.
행 추가 작업이 완료된 후 요약이 업데이트됩니다. 정렬, 필터링 등과 같은 다른 데이터 보기 종속 기능에도 동일하게 적용됩니다.
Customizing Row Adding Overlay
Customizing Text
RowAddTextDirective
를 사용하여 오버레이를 추가하는 행의 텍스트를 사용자 정의할 수 있습니다.
<IgbGrid Data ="data" PrimaryKey ="ProductID" AutoGenerate ="false" RowEditable ="true" RowAddTextTemplate ="addTextTemplate" >
</IgbGrid >
@code {
private RenderFragment <IgbGridEmptyTemplateContext > addTextTemplate = (context) =>
{
return @<span>Adding Row</span>;
};
}
razor
RowEditActions
템플릿을 사용하면 행 편집 오버레이의 버튼을 사용자 정의할 수 있습니다.
<IgbGrid Data ="data" PrimaryKey ="ProductID" AutoGenerate ="false" RowEditable ="true" RowEditActionsTemplateScript ="rowEditActionsTemplate" >
</IgbGrid >
//In JavaScript:
igRegisterScript("rowEditActionsTemplate", (endRowEdit) => {
var html = window.igTemplating.html;
return html`<div class ="row-actions" >
<button @click ="${evt => endRowEdit.implicit(false, evt)}" > Cancel</button >
<button @click ="${evt => endRowEdit.implicit(true, evt)}" > Apply</button >
</div > `
}, false);
razor
참고 : RowEditActions
템플릿을 사용하면 오버레이 버튼 편집 및 추가에 대한 편집 작업이 변경됩니다.
Styling
행 추가 UI는 IgbActionStrip
편집 작업의 버튼, 편집 편집기 및 오버레이, 최종 사용자가 새로 추가된 행으로 스크롤할 수 있는 스낵바로 구성됩니다. 이러한 구성 요소의 스타일을 지정하려면 해당 항목의 포괄적인 가이드를 참조할 수 있습니다.
API References
Additional Resources
우리 커뮤니티는 활동적이며 항상 새로운 아이디어를 환영합니다.