Server side processing for DataTables
Java Groovy
Switch branches/tags
Nothing to show
Pull request Compare This branch is 31 commits behind tlipinski:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

#datatables-ss Server side processing for datatables.

##How to make basic setup? ###Setup html table somewhere in JSP for instance:

    <table id="example">
      <tbody> </tbody>

###Setup your datatable with bServerSide and sAjaxSource options:

    $(document).ready(function() {
            "aoColumns": [
              {sName: "engine"},
              {sName: 'browser'},
              {sName: "version"},
              {sName: "platform"},
              {sName: "grade"} ],
            "bServerSide": true,
            "sAjaxSource": "ExampleServlet"

###Add ExampleServlet mappings to web.xml:



###Create to handle datatable POST action: public class HelloServlet extends HttpServlet { private static ServerSideDataTable dataTable;

        static {
            dataTable =
                            .column(Types.text(), "engine")
                            .column(Types.text(), "browser")
                            .column(Types.text(), "platform")
                            .column(Types.numeric(), "version")
                            .column(Types.text(), "grade")

        public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException,
                ServletException {
            doGet(req, resp);

        public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
                IOException {
            DataTablesRequest dataTablesRequest = new DataTablesRequest(req.getParameterMap(), dataTable);
            DataTablesResponse dataTablesResponse = dataTablesRequest.process(rows);


... to be continued ...