File tree Expand file tree Collapse file tree
src/BootstrapBlazor/Components/Table Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1435,7 +1435,10 @@ private void ResetTableColumns()
14351435 {
14361436 var item = _tableColumnStates [ index ] ;
14371437 var col = columnMap [ item . Name ] ;
1438- col . Fixed = ! string . IsNullOrEmpty ( item . Name ) && stateMap . TryGetValue ( item . Name , out var state ) ? stateMap [ item . Name ] . Fixed : false ;
1438+ col . Fixed = ! string . IsNullOrEmpty ( item . Name ) && stateMap . TryGetValue ( item . Name , out var stateF ) ? stateMap [ item . Name ] . Fixed : false ;
1439+ // 这里一定要使用 stateMap[item.Name].Width 而不是 item.Width 因为 item.Width 可能是 null;
1440+ // 以解决持久化回来时,列宽为_visibleColumnsCache里面列宽为null 的问题导致固定列上style时值不正确的问题
1441+ col . Width = ! string . IsNullOrEmpty ( item . Name ) && stateMap . TryGetValue ( item . Name , out var stateW ) ? stateMap [ item . Name ] . Width : col . Width ;
14391442 if ( item . Visible )
14401443 {
14411444 // 增加到可见列缓存集合
You can’t perform that action at this time.
0 commit comments