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.
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});
}