Skip to content

Commit

Permalink
Merge branch 'rel-1.6' into rel-1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
stsrki committed Nov 25, 2024
2 parents 090479a + 79741a9 commit 066e0f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ private class SelectItem
public string Text { get; private set; }
public object Value { get; private set; }
public bool Disabled { get; private set; }

public SelectItem( string text, object value, bool disabled )
{
Text = text;
Expand All @@ -39,8 +40,12 @@ public SelectItem( string text, object value, bool disabled )
protected override void OnInitialized()
{
elementId = IdGenerator.Generate;
base.OnInitialized();
}

if ( Column.Data is not null )
protected override void OnParametersSet()
{
if ( Column?.Data is not null && selectItems?.Count != Column.Data.Count() )
{
selectItems = new();
foreach ( var item in Column.Data )
Expand All @@ -51,8 +56,7 @@ protected override void OnInitialized()
selectItems.Add( new( text, value, disabled ) );
}
}

base.OnInitialized();
base.OnParametersSet();
}

private void OnSelectedValueChanged( object value )
Expand Down Expand Up @@ -92,7 +96,6 @@ protected override async Task OnAfterRenderAsync( bool firstRender )
{
await Focus();
}

}
}
await base.OnAfterRenderAsync( firstRender );
Expand All @@ -115,6 +118,7 @@ public async Task Select()
[CascadingParameter] public DataGrid<TItem> ParentDataGrid { get; set; }

[Inject] public IIdGenerator IdGenerator { get; set; }

/// <summary>
/// Gets or sets the <see cref="IJSUtilitiesModule"/> instance.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ protected bool HasCommandColumn
=> Columns.Any( x => x.ColumnType == DataGridColumnType.Command );

protected int ColumnSpan
=> Columns.Count - ( HasCommandColumn && !ParentDataGrid.Editable ? 1 : 0 );
=> Columns.Where( x => x.Displayable ).Count() - ( HasCommandColumn && !ParentDataGrid.Editable ? 1 : 0 );

/// <summary>
/// Item associated with the data set.
Expand Down

0 comments on commit 066e0f7

Please sign in to comment.