dxSelectBox showClearButton

This commit is contained in:
Sedat ÖZTÜRK 2025-09-29 10:08:24 +03:00
parent 565357ba3e
commit 9ea283712e
3 changed files with 42 additions and 34 deletions

View file

@ -756,10 +756,10 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
new() { Order=2, ColCount=1, ColSpan=1, ItemType="group", Items =
[
new EditingFormItemDto { Order=1, DataField="Country", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
new EditingFormItemDto { Order=2, DataField="City", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox },
new EditingFormItemDto { Order=3, DataField="District", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox },
new EditingFormItemDto { Order=4, DataField="Street", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox },
new EditingFormItemDto { Order=5, DataField="PostalCode", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order=2, DataField="City", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
new EditingFormItemDto { Order=3, DataField="District", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
new EditingFormItemDto { Order=4, DataField="Street", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
new EditingFormItemDto { Order=5, DataField="PostalCode", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox, EditorOptions=showClearButton },
new EditingFormItemDto { Order=6, DataField="Address", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order=7, DataField="Address2", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order=8, DataField="Email", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
@ -1486,9 +1486,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
new() { Order=2, ColCount=1, ColSpan=1, ItemType="group", Items =
[
new EditingFormItemDto { Order=1, DataField="Country", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
new EditingFormItemDto { Order=2, DataField="City", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox },
new EditingFormItemDto { Order=3, DataField="District", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox },
new EditingFormItemDto { Order=4, DataField="Street", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox },
new EditingFormItemDto { Order=2, DataField="City", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
new EditingFormItemDto { Order=3, DataField="District", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
new EditingFormItemDto { Order=4, DataField="Street", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
new EditingFormItemDto { Order=5, DataField="Address", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order=6, DataField="Address2", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order=7, DataField="PostalCode", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox },
@ -11540,11 +11540,11 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items=
[
new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 2, DataField = "Type", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 2, DataField = "Type", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
new EditingFormItemDto { Order = 3, DataField = "Ratio", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxNumberBox },
new EditingFormItemDto { Order = 4, DataField = "Rounding", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxNumberBox },
new EditingFormItemDto { Order = 5, DataField = "IsActive", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxCheckBox },
new EditingFormItemDto { Order = 6, DataField = "UomCategoryId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 6, DataField = "UomCategoryId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
]
}
}),
@ -11880,7 +11880,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 2, DataField = "Progress", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxNumberBox },
new EditingFormItemDto { Order = 3, DataField = "IsDefault", ColSpan = 2, IsRequired = false, EditorType2=EditorTypes.dxCheckBox },
new EditingFormItemDto { Order = 4, DataField = "SkillTypeId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 4, DataField = "SkillTypeId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
]
}
}),
@ -12175,7 +12175,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items=
[
new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 2, DataField = "SkillTypeId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 2, DataField = "SkillTypeId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
]
}
}),
@ -13224,7 +13224,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
new EditingFormItemDto { Order = 1, DataField = "Key", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 2, DataField = "Path", ColSpan = 2, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 3, DataField = "ComponentPath", ColSpan = 2, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 4, DataField = "RouteType", ColSpan = 2, EditorType2 = EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 4, DataField = "RouteType", ColSpan = 2, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
new EditingFormItemDto { Order = 5, DataField = "Authority", ColSpan = 2, EditorType2 = EditorTypes.dxTextBox }
]
}
@ -13511,9 +13511,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
ItemType = "group",
Items =
[
new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 2, DataField = "Description", ColSpan = 2, EditorType2 = EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 3, DataField = "Category", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
new EditingFormItemDto { Order = 2, DataField = "Description", ColSpan = 2, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
new EditingFormItemDto { Order = 3, DataField = "Category", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
new EditingFormItemDto { Order = 4, DataField = "Order", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
new EditingFormItemDto { Order = 5, DataField = "MonthlyPrice", ColSpan = 2, EditorType2 = EditorTypes.dxNumberBox },
new EditingFormItemDto { Order = 6, DataField = "YearlyPrice", ColSpan = 2, EditorType2 = EditorTypes.dxNumberBox },
@ -14251,7 +14251,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
new EditingFormItemDto { Order = 4, DataField = "TaxOffice", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 5, DataField = "Address", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 6, DataField = "Address2", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 7, DataField = "Country", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 7, DataField = "Country", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
new EditingFormItemDto { Order = 8, DataField = "City", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 9, DataField = "District", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 10, DataField = "PostalCode", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
@ -15390,10 +15390,10 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
ItemType = "group",
Items =
[
new EditingFormItemDto { Order = 1, DataField = "Title", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 1, DataField = "Title", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
new EditingFormItemDto { Order = 2, DataField = "Icon", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 4, DataField = "Type", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
new EditingFormItemDto { Order = 4, DataField = "Type", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
new EditingFormItemDto { Order = 5, DataField = "Features", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextArea, EditorOptions="{\"height\":200}" },
]
}
@ -15923,7 +15923,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
ItemType = "group",
Items =
[
new EditingFormItemDto { Order = 1, DataField = "Address", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 1, DataField = "Address", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
new EditingFormItemDto { Order = 2, DataField = "Phone", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 3, DataField = "Email", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 4, DataField = "Location", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox },

View file

@ -3,7 +3,16 @@ import navigationIcon from '@/configs/navigation-icon.config'
import { useLocalization } from '@/utils/hooks/useLocalization'
import CustomStore from 'devextreme/data/custom_store'
import { useState } from 'react'
import { FaPlus, FaTrash, FaEdit, FaFileAlt, FaSave, FaInfo, FaBackward } from 'react-icons/fa'
import {
FaChevronLeft,
FaTrashAlt,
FaPlusCircle,
FaPencilAlt,
FaEye,
FaTools,
FaCloudUploadAlt,
FaSave,
} from 'react-icons/fa'
import { useNavigate } from 'react-router-dom'
import { GridColumnData } from '../list/GridColumnData'
import { useToolbar } from '../list/useToolbar'
@ -175,7 +184,7 @@ const FormButtons = (props: {
size="xs"
variant="default"
className="dx-button dx-button-mode-contained dx-button-normal"
icon={<FaBackward />}
icon={<FaChevronLeft />}
color="gray-500"
title={translate('::Cancel')}
onClick={() => {
@ -185,30 +194,28 @@ const FormButtons = (props: {
navigate(-1)
}
}}
>
</Button>
></Button>
)}
{mode != 'new' && (
<Button
size="xs"
variant="default"
className="dx-button dx-button-mode-contained dx-button-normal"
icon={<FaTrash />}
icon={<FaTrashAlt />}
color="red-500"
title={translate('::Delete')}
onClick={() => {
setDeleteRowId(id)
}}
{...(permissions.d ? {} : { disabled: true })}
>
</Button>
></Button>
)}
{mode != 'new' && (
<Button
size="xs"
variant="default"
className="dx-button dx-button-mode-contained dx-button-normal"
icon={<FaPlus />}
icon={<FaPlusCircle />}
title={translate('::AddNew')}
onClick={() => {
if (onActionNew) {
@ -225,7 +232,7 @@ const FormButtons = (props: {
size="xs"
variant="default"
className="dx-button dx-button-mode-contained dx-button-normal"
icon={<FaEdit />}
icon={<FaPencilAlt />}
title={translate('::Edit')}
onClick={() => {
if (onActionEdit) {
@ -246,7 +253,7 @@ const FormButtons = (props: {
size="xs"
variant="default"
className="dx-button dx-button-mode-contained dx-button-normal"
icon={<FaFileAlt />}
icon={<FaEye />}
title={translate('::Detail')}
onClick={() => {
if (onActionView) {
@ -278,7 +285,7 @@ const FormButtons = (props: {
size="xs"
variant="default"
className="dx-button dx-button-mode-contained dx-button-normal"
icon={<FaInfo />}
icon={<FaTools />}
color="green-500"
title={translate('::ListForms.ListForm.Manage')}
onClick={() => {

View file

@ -11,6 +11,7 @@ import { GridBoxEditorComponent } from './editors/GridBoxEditorComponent'
import { TagBoxEditorComponent } from './editors/TagBoxEditorComponent'
import { RowMode, SimpleItemWithColData } from './types'
import { PlatformEditorTypes } from '@/proxy/form/models'
import dxSelectBox from 'devextreme/ui/select_box'
const FormDevExpress = (props: {
listFormCode: string
@ -58,7 +59,7 @@ const FormDevExpress = (props: {
if (firstItem?.dataField) {
const editor = e.component.getEditor(firstItem.dataField)
editor?.focus()
mode !== 'view' && editor?.focus()
}
}}
>
@ -130,9 +131,9 @@ const FormDevExpress = (props: {
btn.options.onClick = (e: any) => {
origClick({
...e,
formData: formDataRef.current, // 🔥 her zaman güncel state
formData: formDataRef.current,
fieldName: formItem.dataField,
mode, // "new" | "edit" | "view"
mode,
})
}
}