@@ -33,7 +33,7 @@ Include jupitern/table in your project, by adding it to your composer.json file.
3333## Usage
3434``` php
3535// instance Table with instance name
36- \Jupitern\Table\Table::instance('dt_example' )
36+ \Jupitern\Table\Table::instance()
3737
3838// set data for non ajax requests
3939// using a array
@@ -44,7 +44,7 @@ Include jupitern/table in your project, by adding it to your composer.json file.
4444 ['id' => 2, 'name' => 'John', 'age' => '44', 'phone' => '169 853 741'],
4545])
4646// using json string
47- ->setData(' [[1,"Peter","35","961 168 851"],[2,"John","44","169 853 741"]]' )
47+ ->setData([[1,"Peter","35","961 168 851"],[2,"John","44","169 853 741"]])
4848// using PDO result or your framework ORM. see example how to grab $data at the end
4949->setData($data)
5050
@@ -138,7 +138,7 @@ $data = $db->query("SELECT id, name, age, phone FROM persons")->fetchAll(PDO::FE
138138// used for column filter
139139$filterData = $db->query("SELECT name as val, name FROM persons limit 10")->fetchAll(PDO::FETCH_OBJ);
140140
141- \Jupitern\Table\Table::instance('dt_example' )
141+ \Jupitern\Table\Table::instance()
142142 ->setData($data)
143143 ->attr('id', 'demoTable')
144144 ->attr('class', 'table table-bordered table-striped table-hover')
@@ -176,7 +176,7 @@ $filterData = $db->query("SELECT name as val, name FROM persons limit 10")->fetc
176176 ->render();
177177?>
178178
179- Jquery and Datatables should be included .
179+ Include Jquery, Datatables and Bootstrap (optional) in your html .
180180
181181<!-- JQUERY -->
182182<script src =" https://code.jquery.com/jquery-3.1.1.min.js" ></script >
@@ -190,6 +190,14 @@ Jquery and Datatables should be included.
190190<link href =" https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css" rel =" stylesheet" >
191191<script src =" https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" ></script >
192192
193+ <script type =" text/javascript" >
194+
195+ $ (document ).ready (function (){
196+ $ (' #demoTable' ).DataTable ();
197+ });
198+
199+ </script >
200+
193201```
194202
195203## Roadmap
0 commit comments