From 5c959ff0b83cc99d8d5cfd0f63b039f52e0aaaf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ortega?= Date: Thu, 1 Mar 2018 14:55:38 -0500 Subject: [PATCH] Update README.md --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 9b8cbaa..5a18f87 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,20 @@ filter, err = datatables.Parse(r) if err != nil { //Handle error } + +//Get data from DB + +response := filter.PrepareResponse() +response.RecordsTotal = 629635 +response.RecordsFiltered = 50 +response.Data = rows + +//WriteResponse receive http.ResponseWriter. It send the response even if there are any error. +//Use WriteResponseOnSuccess(w) if you do not want to send the response when there is an error. +response.WriteResponse(w) + +// + ``` # Struct