Grid üzerinde Editte Select çağrısı kaldırıldı
This commit is contained in:
parent
95e6dfbb13
commit
cc0c108dc3
1 changed files with 52 additions and 30 deletions
|
|
@ -28,6 +28,7 @@ import DataGrid, {
|
|||
GroupItem as GroupItemDx,
|
||||
GroupPanel,
|
||||
HeaderFilter,
|
||||
IStateStoringProps,
|
||||
LoadPanel,
|
||||
Pager,
|
||||
Paging,
|
||||
|
|
@ -638,7 +639,7 @@ const Grid = (props: GridProps) => {
|
|||
|
||||
// DataSource oluştur
|
||||
useEffect(() => {
|
||||
if (!gridDto || !columnData) return
|
||||
if (!gridDto) return
|
||||
|
||||
const dataSource = createSelectDataSource(
|
||||
gridDto.gridOptions,
|
||||
|
|
@ -649,7 +650,46 @@ const Grid = (props: GridProps) => {
|
|||
)
|
||||
|
||||
setGridDataSource(dataSource)
|
||||
}, [gridDto, searchParams, columnData])
|
||||
}, [gridDto, searchParams])
|
||||
|
||||
useEffect(() => {
|
||||
if (!columnData) return
|
||||
|
||||
refListFormCode.current = listFormCode
|
||||
if (!gridRef?.current) {
|
||||
return
|
||||
}
|
||||
|
||||
const instance = gridRef?.current?.instance()
|
||||
if (instance) {
|
||||
instance.option('columns', columnData)
|
||||
instance.option('remoteOperations', {
|
||||
groupPaging: true,
|
||||
filtering: true,
|
||||
sorting: true,
|
||||
paging: true,
|
||||
grouping: true,
|
||||
summary: true,
|
||||
})
|
||||
instance.option('dataSource', gridDataSource)
|
||||
instance.state(null)
|
||||
|
||||
const stateStoring: IStateStoringProps = {
|
||||
enabled: gridDto?.gridOptions.stateStoringDto?.enabled,
|
||||
type: gridDto?.gridOptions.stateStoringDto?.type,
|
||||
savingTimeout: gridDto?.gridOptions.stateStoringDto?.savingTimeout,
|
||||
storageKey: gridDto?.gridOptions.stateStoringDto?.storageKey,
|
||||
}
|
||||
if (
|
||||
gridDto?.gridOptions.stateStoringDto?.enabled &&
|
||||
gridDto?.gridOptions.stateStoringDto?.type === 'custom'
|
||||
) {
|
||||
stateStoring.customSave = customSaveState
|
||||
stateStoring.customLoad = customLoadState
|
||||
}
|
||||
instance.option('stateStoring', stateStoring)
|
||||
}
|
||||
}, [columnData])
|
||||
|
||||
useEffect(() => {
|
||||
const activeFilters = extraFilters.filter((f) => f.value)
|
||||
|
|
@ -838,16 +878,16 @@ const Grid = (props: GridProps) => {
|
|||
ref={gridRef as any}
|
||||
key={`Grid-${listFormCode}-${gridDataSource ? 'loaded' : 'loading'}`}
|
||||
id={'Grid-' + listFormCode}
|
||||
dataSource={gridDataSource}
|
||||
columns={columnData}
|
||||
remoteOperations={{
|
||||
groupPaging: true,
|
||||
filtering: true,
|
||||
sorting: true,
|
||||
paging: true,
|
||||
grouping: true,
|
||||
summary: true,
|
||||
}}
|
||||
// dataSource={gridDataSource}
|
||||
// columns={columnData}
|
||||
// remoteOperations={{
|
||||
// groupPaging: true,
|
||||
// filtering: true,
|
||||
// sorting: true,
|
||||
// paging: true,
|
||||
// grouping: true,
|
||||
// summary: true,
|
||||
// }}
|
||||
height={
|
||||
gridDto.gridOptions.height > 0
|
||||
? gridDto.gridOptions.height
|
||||
|
|
@ -905,24 +945,6 @@ const Grid = (props: GridProps) => {
|
|||
}}
|
||||
onEditorPreparing={onEditorPreparing}
|
||||
>
|
||||
<StateStoring
|
||||
enabled={gridDto.gridOptions.stateStoringDto?.enabled}
|
||||
type={gridDto.gridOptions.stateStoringDto?.type}
|
||||
savingTimeout={gridDto.gridOptions.stateStoringDto?.savingTimeout}
|
||||
storageKey={gridDto.gridOptions.stateStoringDto?.storageKey}
|
||||
customSave={
|
||||
gridDto?.gridOptions.stateStoringDto?.enabled &&
|
||||
gridDto?.gridOptions.stateStoringDto?.type === 'custom'
|
||||
? customSaveState
|
||||
: undefined
|
||||
}
|
||||
customLoad={
|
||||
gridDto?.gridOptions.stateStoringDto?.enabled &&
|
||||
gridDto?.gridOptions.stateStoringDto?.type === 'custom'
|
||||
? customLoadState
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
<Export
|
||||
enabled={gridDto.gridOptions.exportDto?.enabled}
|
||||
allowExportSelectedData={gridDto.gridOptions.exportDto?.allowExportSelectedData}
|
||||
|
|
|
|||
Loading…
Reference in a new issue