    def callback(self, request):
        """
        This method is used to handle ajax requests.
        """
        post = request.POST
        action = post.get("_action")

        # call admin
        if hasattr(self, action):
            func, action, description = self.get_action(action)
            qs = self._get_queryset(request)
            r = func(self, request, qs)
            if r is None:
                return JsonResponse(data={
                    "status": "success",
                    "msg": "Success!"
                })
            if isinstance(r, HttpResponseRedirect):
                return JsonResponse(data={
                    "status": "redirect",
                    "url": r.url
                })
            elif isinstance(r, JsonResponse):
                return r
            elif isinstance(r, dict):
                return JsonResponse(data=r)
            else:
                logging.warning(f"action {action} return type is {type(r)}")
                return JsonResponse(data={"status": "error", "msg": r})
This method is used to handle ajax requests.
simpleui/admin.py