php - data tables showing all records instead of pagination while giving data through server json -


this json output.

{     "draw": 0,     "recordstotal": 130,     "recordsfiltered": 130,     "data": [         {             "order_id": "32",             "location_address": "xyz road delhi delhi",             "order_status": "0",             "created_by": "5",             "from_date": "mar-30-2015",             "emp_name": " ",             "actions": "\r\n\t\t\t\t\t<a onclick=\"show_edit()\" class=\"btn default btn-xs purple \">\r\n                                               <i class=\"fa fa-edit\" ></i> edit </a>"         },         {             "order_id": "33",             "location_address": "xyz road delhi delhi",             "order_status": "0",             "created_by": "5",             "from_date": "mar-30-2015",             "emp_name": " ranjeet thakur, abhijeet thakur",             "actions": "\r\n\t\t\t\t\t<a onclick=\"show_edit()\" class=\"btn default btn-xs purple \">\r\n                                               <i class=\"fa fa-edit\" ></i> edit </a>"         },         {             "order_id": "34",             "location_address": "xyz road delhi delhi",             "order_status": "0",             "created_by": "5",             "from_date": "mar-31-2015",             "emp_name": " ",             "actions": "\r\n\t\t\t\t\t<a onclick=\"show_edit()\" class=\"btn default btn-xs purple \">\r\n                                               <i class=\"fa fa-edit\" ></i> edit </a>"         },         {             "order_id": "35",             "location_address": "xyz road delhi delhi",             "order_status": "0",             "created_by": "5",             "from_date": "mar-31-2015",             "emp_name": " super employee",             "actions": "\r\n\t\t\t\t\t<a onclick=\"show_edit()\" class=\"btn default btn-xs purple \">\r\n                                               <i class=\"fa fa-edit\" ></i> edit </a>"         },         {             "order_id": "36",             "location_address": "xyz road delhi delhi",             "order_status": "0",             "created_by": "5",             "from_date": "mar-31-2015",             "emp_name": " ",             "actions": "\r\n\t\t\t\t\t<a onclick=\"show_edit()\" class=\"btn default btn-xs purple \">\r\n                                               <i class=\"fa fa-edit\" ></i> edit </a>"         }     ] } 

"pagelength": 10 (it should show 10 records on single page.)

still showing 130 records on 1 page. want show 10 records on single page.. how can show..?

initialization of plugin :-

datatable: {                  "lengthmenu": [                     [10, 20, 50, 100, 150, -1],                     [10, 20, 50, 100, 150, "all"]                  ],                 "pagelength": 10,     aocolumns: [     { mdata: 'order_id'},     { mdata: 'user_name'},     { mdata: 'location_address'},     { mdata: 'from_date'},     { mdata: 'assign_to'},        { mdata: 'order_status'},     { mdata: 'actions'}     ],  "ajax": {                     "url": page.php,                 } 

any appreciated.

thank in advance.


Comments

Popular posts from this blog

python - Specify path of savefig with pylab or matplotlib -

How to run C# code using mono without Xamarin in Android? -

html - grunt SVG to webfont -