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

View file

@ -24,24 +24,49 @@ const cellTemplateMultiValue = (
cellInfo: DataGridTypes.ColumnCellTemplateData<any, any>,
) => {
if (cellInfo?.value) {
const text = Array.isArray(cellInfo.value)
? cellInfo.value
.map((a: any) => {
const { lookup } = cellInfo.column
if (lookup && lookup.calculateCellValue) {
return lookup.calculateCellValue(a)
}
const values = Array.isArray(cellInfo.value)
? cellInfo.value.map((a: any) => {
const { lookup } = cellInfo.column
if (lookup && lookup.calculateCellValue) {
return lookup.calculateCellValue(a)
}
return ''
})
: [cellInfo.value]
return ''
})
.join(', ')
: cellInfo.value
// Badge benzeri HTML üret
const html = values
.filter((v) => v)
.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
cellElement.title = text
console.log({ html })
cellElement.innerHTML = html
cellElement.title = values.join(',')
}
}
function calculateFilterExpressionMultiValue(
this: DataGridTypes.Column,
filterValue: any,