Skip to content

Instantly share code, notes, and snippets.

@codeleson
Created June 30, 2018 09:35
Show Gist options
  • Save codeleson/72756294e2f3aa12f0a67fed13462629 to your computer and use it in GitHub Desktop.
Save codeleson/72756294e2f3aa12f0a67fed13462629 to your computer and use it in GitHub Desktop.
my api url is http://genuinecodes.com/testing/ and using is on right.js but there is not working and console showing error
Uncaught TypeError: Cannot read property 'class' of undefined
at Object.template (right.js:124)
at HTMLTableCellElement.<anonymous> (scripts.bundle.js:1)
at Function.each (vendors.bundle.js:1)
at _.fn.init.each (vendors.bundle.js:1)
at HTMLTableRowElement.<anonymous> (scripts.bundle.js:1)
at Function.each (vendors.bundle.js:1)
at _.fn.init.each (vendors.bundle.js:1)
at Object.setupTemplateCell (scripts.bundle.js:1)
at Object.insertData (scripts.bundle.js:1)
at Object.l (scripts.bundle.js:1)
and code is inside file
$data = array
(
'2' => array
(
'A' => 'User One',
'B' => '9650934983',
'C' => 'Hii',
'D' => 'Create Material Design scrollable table based on Bootstrap grid. Vertical scrolling tbody, and thead is helpful when you need to display a lot of data. Responsive table with the independent scroll bar is a great solution!',
'E' => '9650934983'
),
'3' => array
(
'A' => 'User One',
'B' => '9650934983',
'C' => 'Hii',
'D' => 'Create Material Design scrollable table based on Bootstrap grid. Vertical scrolling tbody, and thead is helpful when you need to display a lot of data. Responsive table with the independent scroll bar is a great solution!',
'E' => '9650934983'
),
'4' => array
(
'A' => 'User One',
'B' => '9650934983',
'C' => 'Hii',
'D' => 'Create Material Design scrollable table based on Bootstrap grid. Vertical scrolling tbody, and thead is helpful when you need to display a lot of data. Responsive table with the independent scroll bar is a great solution!',
'E' => '9650934983'
)
);
$json = array(
'meta'=>array(
'page' => 1,
'pages'=> 1,
'perpage'=> -1,
'total' => count($data),
'sort' => 'asc',
'field' => 'id'
),
'data' => $data
);
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type, Content-Range, Content-Disposition, Content-Description');
echo json_encode($json, JSON_PRETTY_PRINT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment