Skip to content

Serverside realisation of grouping, filtering and sorting for DevExtreme datagrid on django rest framework

License

Notifications You must be signed in to change notification settings

abnerh69/drf-dx-datagrid

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drf-dx-datagrid

Overview

This package provides easy integration between Django REST framework and DevExreme Data Grid

Install drf-dx-datagrid, replace classname ModelViewSet to DxModelViewSet in your django project and it will support devextreme load options and will return a JSON structure that is fully compatible with what Data Grid expects. It handles grouping, paging, filtering and ordering on serverside.

Configuration

Define your ModelViewSet classes as on this example:

from drf_dx_datagrid import DxModelViewSet

class MyModelViewSet(DxModelViewSet):
    serializer_class = MyModelSerializer
    queryset = core.models.MyModel.objects.all()

JS example:

import CustomStore from 'devextreme/data/custom_store';
import axios from "axios";

export const getUpsStore = (my_url, customStoreOptions) => {
    const load = (loadOptions) => {
        return axios(`${my_url}`, {
                params: loadOptions
            }
        ).then((response) => response.data
        )
    };
    return new CustomStore({...customStoreOptions, load: load});
}

About

Serverside realisation of grouping, filtering and sorting for DevExtreme datagrid on django rest framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%