Grid üzerinde TagBox larda Badge gösterimi

This commit is contained in:
Sedat Öztürk 2025-10-23 22:54:08 +03:00
parent a4adc860ff
commit 9034d1ec39
2 changed files with 40 additions and 15 deletions

View file

@ -37527,7 +37527,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
CultureName = LanguageCodes.En, CultureName = LanguageCodes.En,
SourceDbType = DbType.String, SourceDbType = DbType.String,
FieldName = "Name", FieldName = "Name",
Width = 300, Width = 250,
ListOrderNo = 2, ListOrderNo = 2,
Visible = true, Visible = true,
IsActive = true, IsActive = true,
@ -37561,7 +37561,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
CultureName = LanguageCodes.En, CultureName = LanguageCodes.En,
SourceDbType = DbType.String, SourceDbType = DbType.String,
FieldName = "Description", FieldName = "Description",
Width = 600, Width = 450,
ListOrderNo = 3, ListOrderNo = 3,
Visible = true, Visible = true,
IsActive = true, IsActive = true,

View file

@ -24,24 +24,49 @@ const cellTemplateMultiValue = (
cellInfo: DataGridTypes.ColumnCellTemplateData<any, any>, cellInfo: DataGridTypes.ColumnCellTemplateData<any, any>,
) => { ) => {
if (cellInfo?.value) { if (cellInfo?.value) {
const text = Array.isArray(cellInfo.value) const values = Array.isArray(cellInfo.value)
? cellInfo.value ? cellInfo.value.map((a: any) => {
.map((a: any) => { const { lookup } = cellInfo.column
const { lookup } = cellInfo.column if (lookup && lookup.calculateCellValue) {
if (lookup && lookup.calculateCellValue) { return lookup.calculateCellValue(a)
return lookup.calculateCellValue(a) }
} return ''
})
: [cellInfo.value]
return '' // Badge benzeri HTML üret
}) const html = values
.join(', ') .filter((v) => v)
: cellInfo.value .map(
(v) => `
<div
style="
display:inline-block;
background-color:#dc3545;
color:#fff;
border-radius:12px;
padding:2px 8px;
margin:2px 2px;
font-size:12px;
font-weight:300;
line-height:1.4;
white-space:nowrap;
"
>
${v}
</div>
`
)
.join('')
cellElement.textContent = text console.log({ html })
cellElement.title = text
cellElement.innerHTML = html
cellElement.title = values.join(',')
} }
} }
function calculateFilterExpressionMultiValue( function calculateFilterExpressionMultiValue(
this: DataGridTypes.Column, this: DataGridTypes.Column,
filterValue: any, filterValue: any,